update active_font_index if out or range
This commit is contained in:
parent
4caaa5b687
commit
30235b565c
1 changed files with 8 additions and 1 deletions
|
@ -257,7 +257,14 @@ class ABC3D_text_properties(bpy.types.PropertyGroup):
|
|||
#TODO: simply, merge, cut cut cut
|
||||
class ABC3D_data(bpy.types.PropertyGroup):
|
||||
available_fonts: bpy.props.CollectionProperty(type=ABC3D_available_font, name="Available fonts")
|
||||
active_font_index: bpy.props.IntProperty()
|
||||
def active_font_index_update(self, context):
|
||||
if len(self.available_fonts) <= self.active_font_index:
|
||||
self.active_font_index = len(self.available_fonts) - 1
|
||||
|
||||
active_font_index: bpy.props.IntProperty(
|
||||
default=-1,
|
||||
update=active_font_index_update,
|
||||
)
|
||||
available_texts: bpy.props.CollectionProperty(type=ABC3D_text_properties, name="Available texts")
|
||||
def active_text_index_update(self, context):
|
||||
if self.active_text_index != -1:
|
||||
|
|
Loading…
Reference in a new issue