summaryrefslogtreecommitdiffstats
path: root/wgpu
diff options
context:
space:
mode:
Diffstat (limited to 'wgpu')
-rw-r--r--wgpu/src/renderer/widget/text_input.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/wgpu/src/renderer/widget/text_input.rs b/wgpu/src/renderer/widget/text_input.rs
index 9093b0c6..ab0ba363 100644
--- a/wgpu/src/renderer/widget/text_input.rs
+++ b/wgpu/src/renderer/widget/text_input.rs
@@ -23,11 +23,11 @@ impl text_input::Renderer for Renderer {
Size::INFINITY,
);
- let spaces_at_the_end = value.len() - value.trim_end().len();
+ let spaces_around = value.len() - value.trim().len();
- if spaces_at_the_end > 0 {
+ if spaces_around > 0 {
let space_width = self.text_pipeline.space_width(size as f32);
- width += spaces_at_the_end as f32 * space_width;
+ width += spaces_around as f32 * space_width;
}
width