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

fix: Make gradient resizing refresh and not use cached textures #4693

Conversation

adamantike
Copy link
Contributor

@adamantike adamantike commented Mar 3, 2024

Description:

Avoid using cached textures for gradients, by refreshing the object on resize.

Fixes #4608.

Checklist:

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

@adamantike adamantike mentioned this pull request Mar 3, 2024
2 tasks
@adamantike adamantike force-pushed the fix/expire-gradient-cache-when-size-changes branch from 6f1bf29 to d541a95 Compare March 3, 2024 15:26
Jacalz
Jacalz previously requested changes Mar 4, 2024
Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this. I just have a comment on the interface perhaps being unnecessary.

canvasobject.go Outdated Show resolved Hide resolved
@andydotxyz
Copy link
Member

I would check out how Rectangle (when stroke is on) or the Image canvas types, they already reset the cache when resized.
I agree with @Jacalz this should not require any new API.

@adamantike adamantike force-pushed the fix/expire-gradient-cache-when-size-changes branch from 211c506 to 960fe0e Compare March 5, 2024 03:27
@adamantike adamantike changed the title fix: Expire gradient cache based on texture size fix: Make gradient resizing refresh and not use cached textures Mar 5, 2024
@adamantike adamantike force-pushed the fix/expire-gradient-cache-when-size-changes branch from 960fe0e to b5fd9fb Compare March 5, 2024 03:30
Avoid using cached textures for gradients, by refreshing the object on
resize.

Fixes fyne-io#4608.
@adamantike adamantike force-pushed the fix/expire-gradient-cache-when-size-changes branch from b5fd9fb to c0bd61c Compare March 12, 2024 04:03
@Jacalz Jacalz self-requested a review March 12, 2024 07:04
@dweymouth dweymouth added this to the v2.4.5 milestone Mar 12, 2024
@dweymouth dweymouth dismissed Jacalz’s stale review March 13, 2024 23:56

requested changes were made

canvas/gradient.go Outdated Show resolved Hide resolved
@Jacalz
Copy link
Member

Jacalz commented Mar 19, 2024

I forgot to review this one. Sorry about that. Plan to do so tomorrow evening

@dweymouth dweymouth merged commit cb5de39 into fyne-io:develop Mar 19, 2024
12 checks passed
@dweymouth
Copy link
Contributor

I forgot to review this one. Sorry about that. Plan to do so tomorrow evening

Oh whoops, I just merged before I saw this

@Jacalz
Copy link
Member

Jacalz commented Mar 19, 2024

No problem. I thought you couldn't merge before I had approved so I'm kind of just glad that you relieved me of my duties :)

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.

None yet

4 participants