From a8870397079d915be918c8d63d4e880fa3eb18ca Mon Sep 17 00:00:00 2001 From: Jonathan Westhues Date: Thu, 24 Sep 2009 08:04:46 -0800 Subject: [PATCH] Show info when a Constraint::COMMENT is selected, so that the user can apply a style that way too; and apply the export scale factor to the line width. [git-p4: depot-paths = "//depot/solvespace/": change = 2034] --- export.cpp | 4 ++-- textwin.cpp | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/export.cpp b/export.cpp index bab8996..4958e31 100644 --- a/export.cpp +++ b/export.cpp @@ -426,7 +426,7 @@ void VectorFileWriter::Output(SEdgeList *sel, SBezierList *sbl, SMesh *sm) { if(!Style::Exportable(e->auxA)) continue; DWORD rgb = Style::Color (e->auxA, true); - double w = Style::WidthMm(e->auxA); + double w = Style::WidthMm(e->auxA)*s; LineSegment(rgb, w, e->a.x, e->a.y, e->b.x, e->b.y); } } @@ -435,7 +435,7 @@ void VectorFileWriter::Output(SEdgeList *sel, SBezierList *sbl, SMesh *sm) { if(!Style::Exportable(b->auxA)) continue; DWORD rgb = Style::Color (b->auxA, true); - double w = Style::WidthMm(b->auxA); + double w = Style::WidthMm(b->auxA)*s; Bezier(rgb, w, b); } } diff --git a/textwin.cpp b/textwin.cpp index 0cc265d..00fa1e5 100644 --- a/textwin.cpp +++ b/textwin.cpp @@ -207,7 +207,7 @@ void TextWindow::Show(void) { Printf(false, "%s", SS.GW.pending.description); Printf(true, "%Fl%f%Ll(cancel operation)%E", &TextWindow::ScreenUnselectAll); - } else if(gs.n > 0) { + } else if(gs.n > 0 || gs.stylables > 0) { if(edit.meaning != EDIT_TTF_TEXT) HideTextEditControl(); ShowHeader(false); DescribeSelection(); @@ -483,6 +483,8 @@ void TextWindow::DescribeSelection(void) { double d = (p1.Minus(p0)).Dot(n0); Printf(true, " distance = %Fi%s", SS.MmToString(d)); } + } else if(gs.n == 0) { + Printf(true, "%FtSELECTED:%E comment text"); } else { Printf(true, "%FtSELECTED:%E %d item%s", gs.n, gs.n == 1 ? "" : "s"); } @@ -500,13 +502,20 @@ void TextWindow::DescribeSelection(void) { } // If any of the selected entities have an assigned style, then offer // the option to remove that style. + bool styleAssigned = false; for(i = 0; i < gs.entities; i++) { Entity *e = SK.GetEntity(gs.entity[i]); if(e->style.v != 0) { - break; + styleAssigned = true; } } - if(i < gs.entities) { + for(i = 0; i < gs.constraints; i++) { + Constraint *c = SK.GetConstraint(gs.constraint[i]); + if(c->type == Constraint::COMMENT && c->disp.style.v != 0) { + styleAssigned = true; + } + } + if(styleAssigned) { Printf(true, "%Fl%D%f%Ll(remove assigned style)%E", 0, &ScreenAssignSelectionToStyle);