Make Presentation.update() optional
This commit is contained in:
parent
5d2b063bc8
commit
297cf35da6
@ -240,9 +240,6 @@ class ForkNodeItem(Presentation[UML.ForkNode], HandlePositionUpdate, Named):
|
||||
def ports(self):
|
||||
return self._ports
|
||||
|
||||
def update(self, context):
|
||||
pass
|
||||
|
||||
def save(self, save_func):
|
||||
save_func("matrix", tuple(self.matrix))
|
||||
save_func("height", float(self._handles[1].pos.y))
|
||||
|
@ -100,9 +100,6 @@ class ExecutionSpecificationItem(
|
||||
pt, pb = (h.pos for h in self._handles)
|
||||
return Rectangle(pt.x - d / 2, pt.y, d, y1=pb.y)
|
||||
|
||||
def update(self, context):
|
||||
pass
|
||||
|
||||
def draw(self, context):
|
||||
self.shape.draw(context, self.dimensions())
|
||||
|
||||
|
@ -370,8 +370,9 @@ class Diagram(PackageableElement):
|
||||
|
||||
def _update_items(self, items):
|
||||
for item in items:
|
||||
context = UpdateContext(style=self.style(StyledItem(item)))
|
||||
item.update(context)
|
||||
update = getattr(item, "update", None)
|
||||
if update:
|
||||
update(UpdateContext(style=self.style(StyledItem(item))))
|
||||
|
||||
def _on_constraint_solved(self, cinfo: gaphas.connections.Connection) -> None:
|
||||
dirty_items = set()
|
||||
|
@ -221,9 +221,6 @@ class LinePresentation(gaphas.Line, HandlePositionUpdate, Presentation[S]):
|
||||
self.remove_watch_handle(handle)
|
||||
super().remove_handle(handle)
|
||||
|
||||
def update(self, context):
|
||||
pass
|
||||
|
||||
def update_shape_bounds(self, context):
|
||||
def shape_bounds(shape, align):
|
||||
if shape:
|
||||
|
Loading…
x
Reference in New Issue
Block a user