@@ -819,30 +819,26 @@ def updateObject(self, obj : wmwpy.classes.Object | None):
819
819
tags = ('object' , 'foreground' , id )
820
820
)
821
821
822
- if self .settings .get ('view.radius' , True ) and obj .Type is not None :
823
- properties = deepcopy ( obj .defaultProperties )
824
- properties . update ( obj . properties )
822
+ if ( obj == self .selectedObject or self . settings .get ('view.radius' , True ) ) and obj .Type is not None :
823
+ properties = filter ( lambda name : obj .Type . PROPERTIES [ name ]. get ( 'type' , 'string' ) == 'radius' , obj . Type . PROPERTIES )
824
+
825
825
for property in properties :
826
- property_def = obj .Type .PROPERTIES .get (property , {})
827
- if property_def .get ('type' ) != 'radius' :
828
- continue
829
- radius = obj .Type .get_property (property )
830
-
831
- logging .debug (f'radius: { radius } ' )
832
-
833
- radius_canvas_size = self .toLevelCanvasCoord (radius )
834
-
835
- self .level_canvas .create_circle (
836
- pos [0 ],
837
- pos [1 ],
838
- radius_canvas_size ,
839
- fill = '' ,
840
- outline = 'red' ,
841
- width = self .OBJECT_MULTIPLIER ,
842
- tags = ('radius' , property , id )
843
- )
826
+ props = obj .Type .get_properties (property )
827
+ for name , radius in props .items ():
828
+ logging .debug (f'radius: { radius } ' )
829
+ radius_canvas_size = self .toLevelCanvasCoord (radius )
830
+ if radius_canvas_size > 0 :
831
+ self .level_canvas .create_circle (
832
+ pos [0 ],
833
+ pos [1 ],
834
+ radius_canvas_size ,
835
+ fill = '' ,
836
+ outline = 'red' ,
837
+ width = self .OBJECT_MULTIPLIER ,
838
+ tags = ('radius' , property , id )
839
+ )
844
840
845
- if self .settings .get ('view.path' , True ) and obj .Type is not None :
841
+ if ( obj == self .selectedObject or self . settings .get ('view.path' , True ) ) and obj .Type is not None :
846
842
path_points = obj .Type .get_properties ('PathPos#' )
847
843
logging .debug (f'path_points: { path_points } ' )
848
844
if isinstance (path_points , dict ) and len (path_points ) > 0 :
@@ -1863,9 +1859,10 @@ def selectObject(
1863
1859
'id' : None ,
1864
1860
'property' : None ,
1865
1861
}
1866
- if self .selectedObject in self .level .objects :
1867
- self .updateObject (self .selectedObject )
1862
+ old_object = self .selectedObject
1868
1863
self .selectedObject = obj
1864
+ if old_object in self .level .objects :
1865
+ self .updateObject (old_object )
1869
1866
1870
1867
if isinstance (partInfo , dict ):
1871
1868
self .selectedPart ['type' ] = partInfo .get ('type' , None )
0 commit comments