You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
creating a druid::widget::Painter to indicate the state should dynamically change the style of the widget. we can also add a druid::widget::Label to represent the state.
with the Label added, the app acts as intended (a "good" state is when string.len() is even):
however, when the Label is absent, the Painter no longer updates as expected, when the text in the TextBox is updated:
however, unfocusing the window will trigger the Painter to draw correctly:
what we have so far
my env is... esoteric. Arch Linux 5.6.11, i3 + Xorg, GTK3 3.24.20, but i also reproduced this on my macbook, macOS Mojave 10.14.6.
gdb and ole fashioned print debugging show that the closure passed to Painter is being run -- color is updated, values are calculated, etc. --, but i haven't dug into the ctx.stroke or ctx.fill enough to know exactly what is happening, and i'm still learning the draw system in general (i'm pretty new to druid).
i worked up this minimal example, but my original widget was a simple file viewer, using a more complicated state including things like PathBuf and some homebrewed druid::Data types. the basic behavior is the same, though. anyway, i pressed on thinking that something else in the hierarchy might trigger the redraw, and i was right! but this seems like a bug, so i went ahead and opened an issue.
Description
given some state:
creating a
druid::widget::Painter
to indicate the state should dynamically change the style of the widget. we can also add adruid::widget::Label
to represent the state.with the
Label
added, the app acts as intended (a "good" state is whenstring.len()
is even):however, when the
Label
is absent, thePainter
no longer updates as expected, when the text in theTextBox
is updated:however, unfocusing the window will trigger the
Painter
to draw correctly:what we have so far
my env is... esoteric. Arch Linux 5.6.11, i3 + Xorg, GTK3 3.24.20, but i also reproduced this on my macbook, macOS Mojave 10.14.6.
gdb and ole fashioned print debugging show that the closure passed to
Painter
is being run -- color is updated, values are calculated, etc. --, but i haven't dug into thectx.stroke
orctx.fill
enough to know exactly what is happening, and i'm still learning the draw system in general (i'm pretty new to druid).i worked up this minimal example, but my original widget was a simple file viewer, using a more complicated state including things like
PathBuf
and some homebreweddruid::Data
types. the basic behavior is the same, though. anyway, i pressed on thinking that something else in the hierarchy might trigger the redraw, and i was right! but this seems like a bug, so i went ahead and opened an issue.code: https://gist.github.com/covercash2/0ef3185cf25635900363da5b71e4e268
gifs: https://imgur.com/a/ausXF2u
The text was updated successfully, but these errors were encountered: