File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
amulet_map_editor/programs/edit/api/ui Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ def set_speed(evt):
8282 self ._dim_options = SimpleChoiceAny (canvas )
8383 self ._dim_options .SetToolTip (lang .get ("program_3d_edit.file_ui.dim_tooltip" ))
8484 self ._dim_options .SetItems (level .level_wrapper .dimensions )
85- self ._dim_options . SetValue ( level . level_wrapper . dimensions [ 0 ] )
85+ self ._set_dimension ( canvas . dimension )
8686 self ._dim_options .Bind (wx .EVT_CHOICE , self ._on_dimension_change )
8787
8888 self .Add (self ._dim_options , 0 , wx .TOP | wx .BOTTOM | wx .RIGHT | wx .CENTER , 5 )
@@ -172,7 +172,9 @@ def _change_dimension(self, evt: DimensionChangeEvent):
172172 """Run when the dimension attribute in the canvas is changed.
173173 This is run when the user changes the attribute and when it is changed manually in code.
174174 """
175- dimension = evt .dimension
175+ self ._set_dimension (evt .dimension )
176+
177+ def _set_dimension (self , dimension : str ) -> None :
176178 index = self ._dim_options .FindString (dimension )
177179 if not (index == wx .NOT_FOUND or index == self ._dim_options .GetSelection ()):
178180 self ._dim_options .SetSelection (index )
You can’t perform that action at this time.
0 commit comments