mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
widget: remove scale detection hack from Editor
Now that text layout and shaping operate on concrete sizes and not units, Editor no longer needs to detect scaling changes. Remove it. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -34,7 +34,6 @@ type Editor struct {
|
||||
Submit bool
|
||||
|
||||
eventKey int
|
||||
scale int
|
||||
font text.Font
|
||||
textSize fixed.Int26_6
|
||||
blinkStart time.Time
|
||||
@@ -230,11 +229,6 @@ func (e *Editor) Layout(gtx *layout.Context, sh text.Shaper, font text.Font, siz
|
||||
}
|
||||
|
||||
func (e *Editor) layout(gtx *layout.Context, sh text.Shaper) {
|
||||
// Crude configuration change detection.
|
||||
if scale := gtx.Px(unit.Sp(100)); scale != e.scale {
|
||||
e.invalidate()
|
||||
e.scale = scale
|
||||
}
|
||||
cs := gtx.Constraints
|
||||
e.carWidth = fixed.I(gtx.Px(unit.Dp(1)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user