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:
Elias Naur
2020-02-03 23:29:41 +01:00
parent 4c220f4554
commit b0af85d3c3
-6
View File
@@ -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)))