Skip to content
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

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

sdassow
Copy link
Contributor

@sdassow sdassow commented Nov 22, 2024

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:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

Where applicable:

  • Public APIs match existing style and have Since: line.
  • Any breaking changes have a deprecation path or have been discussed.
  • Check for binary size increases when importing new modules.

@sdassow sdassow marked this pull request as draft November 23, 2024 00:13
@coveralls
Copy link

Coverage Status

coverage: 59.947% (-0.05%) from 59.996%
when pulling a9a21a9 on sdassow:improve-scroll-speed
into 6bfd026 on fyne-io:develop.

Comment on lines +39 to +60
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)
}
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants