From ac9c6617e3f70ff53198793806811bc28198060f Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 1 Feb 2025 21:28:52 -0600 Subject: closer to mouse drag not being annoyingly wrong --- eventMouseMove.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'eventMouseMove.go') diff --git a/eventMouseMove.go b/eventMouseMove.go index 0824faf..97c574a 100644 --- a/eventMouseMove.go +++ b/eventMouseMove.go @@ -33,7 +33,7 @@ func mouseMove(g *gocui.Gui) { } } - if msgMouseDown { + if me.globalMouseDown { // log.Info("msgMouseDown == true") // plugin will segfault if you don't keep this inside a check for msgMouseDown // don't move this code out of here @@ -75,13 +75,16 @@ func (tk *guiWidget) moveNew(g *gocui.Gui) { if tk.node.WidgetType == widget.Label { s := fmt.Sprintf("move(%dx%d) %s ###", w, h, tk.cuiName) tk.dumpWidget(s) + outputW, outputH := tk.Size() g.SetView(tk.cuiName, w-xOffset, h-yOffset, w-xOffset+outputW, h-yOffset+outputH+me.FramePadH, 0) me.startOutputW = w - xOffset me.startOutputH = h - yOffset - g.SetViewOnBottom(tk.cuiName) + // g.SetViewOnBottom(tk.cuiName) return } tk.dumpWidget("moveNew() on " + tk.cuiName) + outputW := 140 + outputH := 40 g.SetView("msg", w-xOffset, h-yOffset, w-xOffset+outputW, h-yOffset+outputH+me.FramePadH, 0) me.startOutputW = w - xOffset me.startOutputH = h - yOffset -- cgit v1.2.3