Skip to content

Commit

Permalink
fixed an issue where polygon colors would change when reloaded from disk
Browse files Browse the repository at this point in the history
  • Loading branch information
by408 committed Dec 2, 2023
1 parent 6ec4686 commit e4aea72
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions geom/geomUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ static const char * ss_xgraph_colors[] =
"#6C7B8B", "#FF00FF", "#00CDCD", "navy", "gold" // 11, ..., 15
};

void setCurrentDefaultColor(int color){
ss_default_color_ind = color;
}

std::string getCurrentDefaultColor() {
ss_default_color_ind++;
if (ss_default_color_ind >= 15){
Expand Down
1 change: 1 addition & 0 deletions geom/geomUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <chrono>

std::string getCurrentDefaultColor();
void setCurrentDefaultColor(int color);

struct dPoint{
double x, y;
Expand Down
1 change: 1 addition & 0 deletions gui/polyView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3304,6 +3304,7 @@ void polyView::redo() {


void polyView::reloadPolys() {
setCurrentDefaultColor(0);// reset default color so that reloaded polygons have the same color as before
readAllPolys();
refreshPixmap();
}
Expand Down

0 comments on commit e4aea72

Please sign in to comment.