fixed new gui removing marker annotations when creating new sessions

This commit is contained in:
Blake Harnden 2020-03-03 22:38:03 -08:00
parent 539ca5d22c
commit 4093b2244a
3 changed files with 6 additions and 4 deletions

View file

@ -8,6 +8,7 @@ from typing import TYPE_CHECKING
from core.gui.dialogs.colorpicker import ColorPickerDialog
from core.gui.dialogs.dialog import Dialog
from core.gui.graph import tags
if TYPE_CHECKING:
from core.gui.app import Application
@ -19,7 +20,7 @@ class MarkerDialog(Dialog):
def __init__(
self, master: "Application", app: "Application", initcolor: str = "#000000"
):
super().__init__(master, app, "marker tool", modal=False)
super().__init__(master, app, "Marker Tool", modal=False)
self.app = app
self.color = initcolor
self.radius = MARKER_THICKNESS[0]
@ -56,8 +57,7 @@ class MarkerDialog(Dialog):
def clear_marker(self):
canvas = self.app.canvas
for i in canvas.find_withtag("marker"):
canvas.delete(i)
canvas.delete(tags.MARKER)
def change_color(self, event: tk.Event):
color_picker = ColorPickerDialog(self, self.app, self.color)

View file

@ -534,7 +534,7 @@ class CanvasGraph(tk.Canvas):
y + r,
fill=self.app.toolbar.marker_tool.color,
outline="",
tags="marker",
tags=tags.MARKER,
)
return
if selected is None:

View file

@ -10,6 +10,7 @@ NODE = "node"
WALLPAPER = "wallpaper"
SELECTION = "selectednodes"
THROUGHPUT = "throughput"
MARKER = "marker"
ABOVE_WALLPAPER_TAGS = [
GRIDLINE,
SHAPE,
@ -33,4 +34,5 @@ COMPONENT_TAGS = [
SELECTION,
SHAPE,
SHAPE_TEXT,
MARKER,
]