From 338a647836d346c2e3850ceacb3789b094edac6f Mon Sep 17 00:00:00 2001 From: qydysky Date: Sun, 20 Dec 2020 10:24:21 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96=E5=A4=A7=E9=87=8F=E5=BC=B9?= =?utf8?q?=E5=B9=95=E4=B8=8B=E7=9A=84=E5=B9=B3=E6=BB=91=E6=BB=9A=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Reply/gtk.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Reply/gtk.go b/Reply/gtk.go index be88f60..ca0fb64 100644 --- a/Reply/gtk.go +++ b/Reply/gtk.go @@ -453,15 +453,14 @@ func Gtk_danmu() { return } - loc := int(grid0.Container.GetChildren().Length())/2; - step := 0.1 * (max - cu) - if step > 0.5 { - if step > 5 {step = 5}//限制最大滚动速度 - if loc > max_danmu {step += float64(loc - max_danmu) / 10} - tmp.SetValue(step + cu) + step := (max - cu) / 30 + if step > 0.5 && max - cu < float64(h){ + if step > 5 {step = 5} + tmp.SetValue(cu + step) } else { in_smooth_roll = false tmp.SetValue(max) + loc := int(grid0.Container.GetChildren().Length())/2; for loc > max_danmu { if i,e := grid0.GetChildAt(0,0); e != nil{i.(*gtk.Widget).Destroy()} if i,e := grid0.GetChildAt(1,0); e != nil{i.(*gtk.Widget).Destroy()} -- 2.39.2