Fix bezier_tool placeholder text alignment

This commit is contained in:
Héctor Ramón Jiménez 2020-04-10 02:49:04 +02:00
parent b549b509c9
commit 47d44af348

View File

@ -12,8 +12,8 @@ mod bezier {
// implemented by `iced_wgpu` and other renderers. // implemented by `iced_wgpu` and other renderers.
use iced_native::{ use iced_native::{
input, layout, Clipboard, Color, Element, Event, Font, Hasher, input, layout, Clipboard, Color, Element, Event, Font, Hasher,
HorizontalAlignment, Layout, Length, MouseCursor, Point, Size, Vector, HorizontalAlignment, Layout, Length, MouseCursor, Point, Rectangle,
VerticalAlignment, Widget, Size, Vector, VerticalAlignment, Widget,
}; };
use iced_wgpu::{ use iced_wgpu::{
triangle::{Mesh2D, Vertex2D}, triangle::{Mesh2D, Vertex2D},
@ -189,7 +189,11 @@ mod bezier {
&& self.state.pending.is_none() && self.state.pending.is_none()
{ {
let instructions = Primitive::Text { let instructions = Primitive::Text {
bounds, bounds: Rectangle {
x: bounds.center_x(),
y: bounds.center_y(),
..bounds
},
color: Color { color: Color {
a: defaults.text.color.a * 0.7, a: defaults.text.color.a * 0.7,
..defaults.text.color ..defaults.text.color