mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-01 04:38:11 +08:00
Remove stray float literal .0 suffixes in lieu of just ending with a point (#4233)
Remove the .0 suffix on floats in lieu of just ending with a point
This commit is contained in:
@@ -228,10 +228,10 @@ pub fn text_width(text: &str, font_size: f64) -> f64 {
|
||||
let typesetting = TypesettingConfig {
|
||||
font_size,
|
||||
line_height_ratio: 1.2,
|
||||
character_spacing: 0.0,
|
||||
character_spacing: 0.,
|
||||
max_width: None,
|
||||
max_height: None,
|
||||
tilt: 0.0,
|
||||
tilt: 0.,
|
||||
align: TextAlign::AlignLeft,
|
||||
};
|
||||
|
||||
|
||||
@@ -1215,7 +1215,7 @@ impl OverlayContextInternal {
|
||||
|
||||
fn snap_to_physical_pixel(&self, p: DVec2) -> DVec2 {
|
||||
let s = self.viewport.scale();
|
||||
if !s.is_finite() || s <= 0.0 {
|
||||
if !s.is_finite() || s <= 0. {
|
||||
return p.round();
|
||||
}
|
||||
(p * s).round() / s
|
||||
@@ -1223,7 +1223,7 @@ impl OverlayContextInternal {
|
||||
|
||||
fn snap_to_physical_pixel_center(&self, p: DVec2) -> DVec2 {
|
||||
let s = self.viewport.scale();
|
||||
if !s.is_finite() || s <= 0.0 {
|
||||
if !s.is_finite() || s <= 0. {
|
||||
return p.round() - DVec2::splat(0.5);
|
||||
}
|
||||
self.snap_to_physical_pixel(p) - DVec2::splat(0.5 / s)
|
||||
|
||||
Reference in New Issue
Block a user