-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Improve scroll speed #5283
Conversation
type EventFunc interface { | ||
Execute() | ||
} | ||
|
||
type SimpleEventFunc func() | ||
|
||
func (fn SimpleEventFunc) Execute() { | ||
fn() | ||
} | ||
|
||
type DragEventFunc struct { | ||
wid Draggable | ||
ev *DragEvent | ||
} | ||
|
||
func NewDragEventFunc(wid Draggable, ev *DragEvent) *DragEventFunc { | ||
return &DragEventFunc{wid, ev} | ||
} | ||
|
||
func (drag *DragEventFunc) Execute() { | ||
drag.wid.Dragged(drag.ev) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is a draft PR but just FYI: this adds a public API for something that I suppose only was intended to be used internally? You might want to use one of the packages in the internal/
folder.
Drop for now. Might check back later if still needed after the threading changes. |
Description:
First attempt at improving scroll speed by reducing the amount of calls to Draggable.Dragged.
Big diff because it introduces an interface type for queued events to allow differentiation for optimization purposes.
References:
Checklist:
Where applicable: