diff --git a/vector/prefs.go b/vector/prefs.go index a8d4fbc2..b14049ac 100644 --- a/vector/prefs.go +++ b/vector/prefs.go @@ -116,13 +116,6 @@ func InitPrefs() { Prefs.Defaults() Prefs.Open() // OpenPaths() // todo - // svg.CurIconSet.OpenIconsFromEmbedDir(icons.Icons, ".") - // gi.CustomAppMenuFunc = func(m *gi.Menu, win *gi.Window) { - // m.InsertActionAfter("GoGi Preferences...", gi.ActOpts{Label: "Vector Preferences..."}, - // win, func(recv, send ki.Ki, sig int64, data any) { - // PrefsView(&Prefs) - // }) - // } } // PrefsFileName is the name of the preferences file in GoGi prefs directory diff --git a/vector/svgview.go b/vector/svgview.go index e8c2ef53..de46ccd0 100644 --- a/vector/svgview.go +++ b/vector/svgview.go @@ -178,24 +178,6 @@ func (sv *SVGView) HandleEvents() { sv.UpdateSelect() } } - if !es.InAction() { - switch es.Tool { - case RectTool: - sv.NewElDrag(svg.RectType, es.DragStartPos, e.Pos()) - es.SelBBox.Min.X += 1 - es.SelBBox.Min.Y += 1 - es.DragSelStartBBox = es.SelBBox - es.DragSelCurBBox = es.SelBBox - es.DragSelEffBBox = es.SelBBox - case EllipseTool: - sv.NewElDrag(svg.EllipseType, es.DragStartPos, e.Pos()) - case TextTool: - sv.NewText(es.DragStartPos, e.Pos()) - es.NewTextMade = true - case BezierTool: - sv.NewPath(es.DragStartPos, e.Pos()) - } - } } // if e.MouseButton() == events.Right { // e.SetHandled() @@ -221,10 +203,29 @@ func (sv *SVGView) HandleEvents() { if es.HasSelected() { if !es.NewTextMade { sv.DragMove(e) - return } + return } - if es.Action == "BoxSelect" || (!es.InAction() && es.Tool == SelectTool) { + if !es.InAction() { + switch es.Tool { + case SelectTool: + sv.SetRubberBand(e.Pos()) + case RectTool: + sv.NewElDrag(svg.RectType, es.DragStartPos, e.Pos()) + es.SelBBox.Min.X += 1 + es.SelBBox.Min.Y += 1 + es.DragSelStartBBox = es.SelBBox + es.DragSelCurBBox = es.SelBBox + es.DragSelEffBBox = es.SelBBox + case EllipseTool: + sv.NewElDrag(svg.EllipseType, es.DragStartPos, e.Pos()) + case TextTool: + sv.NewText(es.DragStartPos, e.Pos()) + es.NewTextMade = true + case BezierTool: + sv.NewPath(es.DragStartPos, e.Pos()) + } + } else if es.Action == "BoxSelect" { sv.SetRubberBand(e.Pos()) } })