Make arc default dimenision (radius vs diameter) a configuration option.

pull/1442/head
phkahler 2023-12-21 14:30:52 -05:00 committed by Paul Kahler
parent 1a71ca745a
commit 1f8b3f2589
5 changed files with 16 additions and 1 deletions

View File

@ -70,6 +70,10 @@ void TextWindow::ScreenChangeExportOffset(int link, uint32_t v) {
SS.TW.edit.meaning = Edit::EXPORT_OFFSET;
}
void TextWindow::ScreenChangeArcDimDefault(int link, uint32_t v) {
SS.arcDimDefaultDiameter = !SS.arcDimDefaultDiameter;
}
void TextWindow::ScreenChangeFixExportColors(int link, uint32_t v) {
SS.fixExportColors = !SS.fixExportColors;
}
@ -344,6 +348,9 @@ void TextWindow::ShowConfiguration() {
Printf(false, " %Fd%f%Ll%s edit newly added dimensions%E",
&ScreenChangeImmediatelyEditDimension,
SS.immediatelyEditDimension ? CHECK_TRUE : CHECK_FALSE);
Printf(false, " %Fd%f%Ll%s arc default is diameter%E",
&ScreenChangeArcDimDefault,
SS.arcDimDefaultDiameter ? CHECK_TRUE : CHECK_FALSE);
Printf(false, "");
Printf(false, "%Ft autosave interval (in minutes)%E");
Printf(false, "%Ba %d %Fl%Ll%f[change]%E",

View File

@ -237,7 +237,9 @@ void Constraint::MenuConstrain(Command id) {
c.type = Type::DIAMETER;
c.entityA = gs.entity[0];
Entity* arc = SK.GetEntity(gs.entity[0]);
if (arc->type == EntityBase::Type::ARC_OF_CIRCLE) {
if ((arc->type == EntityBase::Type::ARC_OF_CIRCLE)
&& (!SS.arcDimDefaultDiameter))
{
c.other = true;
}
} else {

View File

@ -69,6 +69,8 @@ void SolveSpaceUI::Init() {
exportScale = settings->ThawFloat("ExportScale", 1.0);
// Export offset (cutter radius comp)
exportOffset = settings->ThawFloat("ExportOffset", 0.0);
// Dimensions on arcs default to diameter vs radius
arcDimDefaultDiameter = settings->ThawBool("ArcDimDefaultDiameter", false);
// Rewrite exported colors close to white into black (assuming white bg)
fixExportColors = settings->ThawBool("FixExportColors", true);
// Export background color
@ -250,6 +252,8 @@ void SolveSpaceUI::Exit() {
settings->FreezeFloat("ExportScale", exportScale);
// Export offset (cutter radius comp)
settings->FreezeFloat("ExportOffset", exportOffset);
// Rewrite the default arc dimension setting
settings->FreezeBool("ArcDimDefaultDiameter", arcDimDefaultDiameter);
// Rewrite exported colors close to white into black (assuming white bg)
settings->FreezeBool("FixExportColors", fixExportColors);
// Export background color

View File

@ -573,6 +573,7 @@ public:
double gridSpacing;
double exportScale;
double exportOffset;
bool arcDimDefaultDiameter;
bool fixExportColors;
bool exportBackgroundColor;
bool drawBackFaces;

View File

@ -442,6 +442,7 @@ public:
static void ScreenShowEditView(int link, uint32_t v);
static void ScreenGoToWebsite(int link, uint32_t v);
static void ScreenChangeArcDimDefault(int link, uint32_t v);
static void ScreenChangeFixExportColors(int link, uint32_t v);
static void ScreenChangeExportBackgroundColor(int link, uint32_t v);
static void ScreenChangeBackFaces(int link, uint32_t v);