Clean up text input (#506)

* Fix firefox text input

* Fix descenders below bounding box

* Fix chromium empty text

* Descenders back below baseline

* Fix trailing newline on chromium

* Reinstate correct baseline height

* Fix highlighted new line on empty text

* Add comment for trailing new line removal

* Extract cleanupTextInput to a separate file

* Function import simplification

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
0HyperCube
2022-02-03 20:26:44 -08:00
committed by Keavon Chambers
co-authored by Keavon Chambers
parent dd36339605
commit 376f4da480
3 changed files with 21 additions and 10 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ pub fn to_kurbo(str: &str, buzz_face: rustybuzz::Face, font_size: f64, line_widt
path: BezPath::new(),
pos: Point::ZERO,
offset: Vec2::ZERO,
ascender: buzz_face.ascender() as f64,
ascender: (buzz_face.ascender() as f64 / buzz_face.height() as f64) * font_size / scale,
scale,
};