You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defwrap_text(text: str, width: int) ->List[str]:
''' Wrap the given text to the given width. Args: width: The maximum pixel width of each row. text: The text to be split and returned. Returns: A list of the split up text and empty space if necessary. '''return_text= []
row_text=''system=bpy.context.preferences.systemdpi=72ifsystem.ui_scale>=1elsesystem.dpiblf.size(0, 10, dpi)
forwordintext.split():
word=f' {word}'line_len, _=blf.dimensions(0, row_text+word)
ifline_len<= (width-16):
row_text+=wordelse:
return_text.append(row_text)
row_text=wordifrow_text:
return_text.append(row_text)
returnreturn_textdefdraw(self, context):
col=self.layout.column()
width=context.region.widthui_scale=context.preferences.system.ui_scaleMSG=f"Or move your already purchased {ds_props.product} pack into this folder:"fortextinwrap_text(MSG, 0.8*(width/ui_scale)):
col.label(text=text)
I'm thinking the main issue of my attempts has been forgetting to include uiscale.
The text was updated successfully, but these errors were encountered:
This works reportedly correctly:
I'm thinking the main issue of my attempts has been forgetting to include uiscale.
The text was updated successfully, but these errors were encountered: