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
Even better is to change the type of width, navDrawerWidth, navDrawerMinimizedWidth to unit.Value, and use
gtx.Constraints.Min.X = gtx.Px(width)
A related issue is the godcr/ui/decredmaterial.pxf function; it is a copy of gioui.org/unit.Metric.Px except that it special-cases the zero scale. I think it is better to never construct zero-valued unit.Metrics and use the standard Px method instead.
running
$ grep "\.PxPer
returns a few instances of explicit use of the pixel-to-dp scale. The pageCommon.layoutNavDrawer converts from Dps to pixels:
gtx.Constraints.Min.X = int(gtx.Metric.PxPerDp) * width
However, PxPerDp may not be integral; a better version is
gtx.Constraints.Min.X = int(gtx.Metric.PxPerDp * width)
Even better is to change the type of width, navDrawerWidth, navDrawerMinimizedWidth to unit.Value, and use
gtx.Constraints.Min.X = gtx.Px(width)
A related issue is the godcr/ui/decredmaterial.pxf function; it is a copy of gioui.org/unit.Metric.Px except that it special-cases the zero scale. I think it is better to never construct zero-valued unit.Metrics and use the standard Px method instead.
This is in reference to Elias' review: https://paste.sr.ht/~eliasnaur/cea1d29d6a5f96668b5e166c2f39ef596974574f
The text was updated successfully, but these errors were encountered: