From 47d44af348db79735233e408b1560661b9f96960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Fri, 10 Apr 2020 02:49:04 +0200 Subject: [PATCH] Fix `bezier_tool` placeholder text alignment --- examples/bezier_tool/src/main.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/bezier_tool/src/main.rs b/examples/bezier_tool/src/main.rs index c3fbf2762a..fcb7733c14 100644 --- a/examples/bezier_tool/src/main.rs +++ b/examples/bezier_tool/src/main.rs @@ -12,8 +12,8 @@ mod bezier { // implemented by `iced_wgpu` and other renderers. use iced_native::{ input, layout, Clipboard, Color, Element, Event, Font, Hasher, - HorizontalAlignment, Layout, Length, MouseCursor, Point, Size, Vector, - VerticalAlignment, Widget, + HorizontalAlignment, Layout, Length, MouseCursor, Point, Rectangle, + Size, Vector, VerticalAlignment, Widget, }; use iced_wgpu::{ triangle::{Mesh2D, Vertex2D}, @@ -189,7 +189,11 @@ mod bezier { && self.state.pending.is_none() { let instructions = Primitive::Text { - bounds, + bounds: Rectangle { + x: bounds.center_x(), + y: bounds.center_y(), + ..bounds + }, color: Color { a: defaults.text.color.a * 0.7, ..defaults.text.color