Show area of closed contour with SI units.
Similar to the way that Analyze → Measure Area... works. Fixes #639.pull/640/head
parent
35c6af4929
commit
211ae8c446
|
@ -767,11 +767,7 @@ void Group::DrawContourAreaLabels(Canvas *canvas) {
|
|||
Canvas::Stroke stroke = Style::Stroke(hs);
|
||||
stroke.layer = Canvas::Layer::FRONT;
|
||||
|
||||
double scale = SS.MmPerUnit();
|
||||
std::string label = ssprintf("%.3f %s²",
|
||||
fabs(sbls.SignedArea() / (scale * scale)),
|
||||
SS.UnitName());
|
||||
|
||||
std::string label = SS.MmToStringSI(fabs(sbls.SignedArea()), /*dim=*/2);
|
||||
double fontHeight = Style::TextHeight(hs);
|
||||
double textWidth = VectorFont::Builtin()->GetWidth(fontHeight, label),
|
||||
textHeight = VectorFont::Builtin()->GetCapHeight(fontHeight);
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.7 KiB |
Loading…
Reference in New Issue