Skip to content

Commit dd24a6b

Browse files
committed
fix marker's symbolsize in backend/item
1 parent 42f9c3d commit dd24a6b

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

src/silx/gui/plot/items/marker.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,22 @@ def __init__(self):
8383
self._constraint = self._defaultConstraint
8484
self.__isBeingDragged = False
8585

86-
def _addRendererCall(self, backend, symbol=None, linestyle="-", linewidth=1):
86+
def _addRendererCall(
87+
self,
88+
backend,
89+
symbol=None,
90+
symbolsize=10.,
91+
linestyle="-",
92+
linewidth=1,
93+
):
8794
"""Perform the update of the backend renderer"""
8895
return backend.addMarker(
8996
x=self.getXPosition(),
9097
y=self.getYPosition(),
9198
text=self.getText(),
9299
color=self.getColor(),
93100
symbol=symbol,
94-
symbolsize=self.getSymbolSize(),
101+
symbolsize=symbolsize,
95102
linestyle=linestyle,
96103
linewidth=linewidth,
97104
constraint=self.getConstraint(),
@@ -248,6 +255,9 @@ class Marker(MarkerBase, SymbolMixIn):
248255
_DEFAULT_SYMBOL = "+"
249256
"""Default symbol of the marker"""
250257

258+
_DEFAULT_SYMBOL_SIZE = 10.0
259+
"""Default size of marker's symbol"""
260+
251261
def __init__(self):
252262
MarkerBase.__init__(self)
253263
SymbolMixIn.__init__(self)
@@ -256,7 +266,11 @@ def __init__(self):
256266
self._y = 0.0
257267

258268
def _addBackendRenderer(self, backend):
259-
return self._addRendererCall(backend, symbol=self.getSymbol())
269+
return self._addRendererCall(
270+
backend,
271+
symbol=self.getSymbol(),
272+
symbolsize=self.getSymbolSize(),
273+
)
260274

261275
def _setConstraint(self, constraint):
262276
"""Set the constraint function of the marker drag.

0 commit comments

Comments
 (0)