Skip to content

Commit

Permalink
fix marker's symbolsize in backend/item
Browse files Browse the repository at this point in the history
  • Loading branch information
t20100 committed Oct 7, 2024
1 parent 42f9c3d commit dd24a6b
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/silx/gui/plot/items/marker.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,22 @@ def __init__(self):
self._constraint = self._defaultConstraint
self.__isBeingDragged = False

def _addRendererCall(self, backend, symbol=None, linestyle="-", linewidth=1):
def _addRendererCall(
self,
backend,
symbol=None,
symbolsize=10.,
linestyle="-",
linewidth=1,
):
"""Perform the update of the backend renderer"""
return backend.addMarker(
x=self.getXPosition(),
y=self.getYPosition(),
text=self.getText(),
color=self.getColor(),
symbol=symbol,
symbolsize=self.getSymbolSize(),
symbolsize=symbolsize,
linestyle=linestyle,
linewidth=linewidth,
constraint=self.getConstraint(),
Expand Down Expand Up @@ -248,6 +255,9 @@ class Marker(MarkerBase, SymbolMixIn):
_DEFAULT_SYMBOL = "+"
"""Default symbol of the marker"""

_DEFAULT_SYMBOL_SIZE = 10.0
"""Default size of marker's symbol"""

def __init__(self):
MarkerBase.__init__(self)
SymbolMixIn.__init__(self)
Expand All @@ -256,7 +266,11 @@ def __init__(self):
self._y = 0.0

def _addBackendRenderer(self, backend):
return self._addRendererCall(backend, symbol=self.getSymbol())
return self._addRendererCall(
backend,
symbol=self.getSymbol(),
symbolsize=self.getSymbolSize(),
)

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

0 comments on commit dd24a6b

Please sign in to comment.