-
-
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
Moving canvas items (e.g. Images) does not cause canvas repaint #2205
Comments
Thanks for this, I think perhaps we should add a flag to the canvas that repaint should be done after a Move call (Resize triggers other repaint events). |
Maybe this should be enough (after sharing code between the two drivers):
// Repaint repaints the containing canvas.
func Repaint(obj fyne.CanvasObject) {
if fyne.CurrentApp() == nil || fyne.CurrentApp().Driver() == nil {
return
}
c := fyne.CurrentApp().Driver().CanvasForObject(obj)
if c != nil {
c.(interface{ SetDirty(bool) }).SetDirty(true)
}
} And then just call this in canvasobject.Move and in BaseWidget implementation (or maybe just in canvas objects 🤔) |
I think if there were to be a |
This needs to be in 2.2 as we don't add API in fixes sorry for the confusion |
Working on it now. Should not have been moved to a point release sadly as noted above due to new api requirement. |
Move refresh to repaint where appropriate And update on moves. Fixes fyne-io#2205
Thanks to the suggestion by @fpabl0 there is a version of this fix without a new API, so trying to get it in to next point release. |
Move refresh to repaint where appropriate And update on moves. Fixes #2205
Describe the bug:
Calling
Move
on a canvas item such ascanvas.Image
does not cause canvas to automatically repaint.Actually there does not seem to be a clean way to just cause canvas to repaint, without recreating the underlying canvas objects
(e.g. calling
image.Refresh
will also recreate the texture created from the image which may be costly).To Reproduce:
Steps to reproduce the behaviour:
canvas.Image
as one or several of its constituent objectsDragged()
method which moves the widget's images, but does not call Refresh on them.Example code:
-->
Device (please complete the following information):
The text was updated successfully, but these errors were encountered: