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

View file

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

View file

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