Skip to content

Commit 4e75064

Browse files
committed
yeah, i don't quite get text
1 parent 294e563 commit 4e75064

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/components/wall.rs

+21-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ impl GizmoComponent for RectWall {
321321
let galley = {
322322
let font_id = FontId::default();
323323
painter.layout_no_wrap(
324-
format!("{}", self.rect.width()),
324+
format!("{} m", self.rect.width()),
325325
font_id,
326326
Color32::WHITE,
327327
)
@@ -337,6 +337,26 @@ impl GizmoComponent for RectWall {
337337
galley.size(),
338338
);
339339
painter.add(TextShape::new(rect.min, galley, Color32::WHITE));
340+
341+
let galley = {
342+
let font_id = FontId::default();
343+
painter.layout_no_wrap(
344+
format!("{} m", self.rect.height()),
345+
font_id,
346+
Color32::WHITE,
347+
)
348+
};
349+
let rect = Align2::LEFT_BOTTOM.anchor_size(
350+
grid_to_image(
351+
Pos2 {
352+
y: (self.get_center().x - self.rect.width() / 2) as f32,
353+
x: self.get_center().y as f32,
354+
},
355+
image_rect,
356+
),
357+
galley.size(),
358+
);
359+
painter.add(TextShape::new(rect.min, galley, Color32::WHITE).with_angle(-std::f32::consts::FRAC_PI_2));
340360
}
341361
ToolType::MoveWall => {
342362
for pos in self.get_gizmo_positions(tool_type) {

0 commit comments

Comments
 (0)