File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,16 @@ def draw(
170
170
if self .label .isVisible ():
171
171
self .label .draw (painter , xMap , yMap , canvasRect )
172
172
173
+ # ----AbstractShape API------------------------------------------------------
174
+ def set_readonly (self , state : bool ) -> None :
175
+ """Set object readonly state
176
+
177
+ Args:
178
+ state: True if object is readonly, False otherwise
179
+ """
180
+ super ().set_readonly (state )
181
+ self .shape .set_readonly (state )
182
+
173
183
# ----Public API-------------------------------------------------------------
174
184
def create_shape (self ):
175
185
"""Return the shape object associated to this annotated shape object"""
@@ -185,6 +195,8 @@ def create_label(self) -> DataInfoLabel:
185
195
label_param = LabelParam (_ ("Label" ), icon = "label.png" )
186
196
label_param .read_config (CONF , "plot" , "shape/label" )
187
197
label_param .anchor = self .LABEL_ANCHOR
198
+ if self .LABEL_ANCHOR == "C" :
199
+ label_param .xc = label_param .yc = 0
188
200
return DataInfoLabel (label_param , [self ])
189
201
190
202
def is_label_visible (self ) -> bool :
Original file line number Diff line number Diff line change @@ -319,7 +319,7 @@ def draw(
319
319
cx = rct .center ().x ()
320
320
painter .drawLine (QC .QPointF (cx , rct .top ()), QC .QPointF (cx , rct .bottom ()))
321
321
322
- if self .can_resize ():
322
+ if self .can_resize () and not self . is_readonly () :
323
323
painter .setPen (pen )
324
324
x0 , x1 , y = self .get_handles_pos ()
325
325
sym .drawSymbol (painter , QC .QPointF (x0 , y ))
@@ -481,7 +481,7 @@ def draw(
481
481
cy = rct .center ().y ()
482
482
painter .drawLine (QC .QPointF (rct .left (), cy ), QC .QPointF (rct .right (), cy ))
483
483
484
- if self .can_resize ():
484
+ if self .can_resize () and not self . is_readonly () :
485
485
painter .setPen (pen )
486
486
y0 , y1 , x = self .get_handles_pos ()
487
487
sym .drawSymbol (painter , QC .QPointF (x , y0 ))
You can’t perform that action at this time.
0 commit comments