Closed LeeeSe closed 3 months ago
Thanks for filling a bug. Could you provide a small testcase we can use to reproduce the problem?
sure
import { Button, VerticalBox, ScrollView } from "std-widgets.slint";
export component AppWindow inherits Window {
VerticalBox {
ScrollView {
VerticalBox {
Text {
text: "first first first first first first first first first first first";
}
Text {
text: "second second second second second second second second second second";
}
}
}
}
}
If you quickly change the size of the window, you will find the problem.
I can reproduce this. The NSView::setLayerContentsPlacement
call we have is supposed to avoid this problem, but it seems that after all the refactoring it's now in a place where it's called too late.
So from what I can see, it jitters when using renderer-femtovg
as well as renderer-skia
(which defaults to metal on macOS), but it is smooth and jitter-free when using renderer-skia-opengl
.
For the OpenGL renderer, the difference is the timing when NSView::setLayerContentsPlacement
(or contentsGravity
on the layer) is set. It must be done /after/ the NSOpenGLContext
is associated with the view - I guess because the corresponding (hidden) layer doesn't exist until then. For Metal it's the same game, we're not setting that at all yet.
https://github.com/slint-ui/slint/assets/44465325/90a9d9e5-d26a-43a3-9c98-cc0a873b2ebe
This problem will not affect normal use, but I still hope to get any solution. Very good GUI library, thank you for your work.