Added option for crop area color/opacy; See issue #355

This commit is contained in:
Oliver Duis
2010-11-27 15:03:52 +01:00
parent 1e613bd602
commit b889b0de3f
3 changed files with 11 additions and 3 deletions

View File

@@ -74,7 +74,9 @@ void drawCrop (Cairo::RefPtr<Cairo::Context> cr, int imx, int imy, int imw, int
double c2x = (cparams.x+cparams.w-1-startx)*scale;
double c2y = (cparams.y+cparams.h-1-starty)*scale;
cr->set_source_rgba (0, 0, 0, 2.0/3.0);
cr->set_source_rgba (options.cutOverlayBrush[0], options.cutOverlayBrush[1], options.cutOverlayBrush[2], options.cutOverlayBrush[3]);
// TODO: not sure if this is right. Seems to leave a thin border on the left/top, but might be bug in calling code
cr->rectangle (imx+0.5, imy+0.5, imw, c1y);
cr->rectangle (imx+0.5, imy+0.5+c2y, imw, imh-c2y);
cr->rectangle (imx+0.5, imy+0.5+c1y, c1x, c2y-c1y+1);

View File

@@ -123,6 +123,9 @@ void Options::setDefaults () {
tabbedUI = false;
multiDisplayMode = 0;
cutOverlayBrush = std::vector<double> (4);
cutOverlayBrush[3] = 0.667;
int babehav[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0};
baBehav = std::vector<int> (babehav, babehav+ADDSET_PARAM_NUM);
@@ -272,6 +275,7 @@ if (keyFile.has_group ("GUI")) {
if (keyFile.has_key ("GUI", "ToolPanelsExpanded")) tpOpen = keyFile.get_integer_list ("GUI", "ToolPanelsExpanded");
if (keyFile.has_key ("GUI", "MultiDisplayMode")) multiDisplayMode = keyFile.get_integer ("GUI", "MultiDisplayMode");
//if (keyFile.has_key ("GUI", "CurvePanelsExpanded")) crvOpen = keyFile.get_integer_list ("GUI", "CurvePanelsExpanded");
if (keyFile.has_key ("GUI", "CutOverlayBrush")) cutOverlayBrush = keyFile.get_double_list ("GUI", "CutOverlayBrush");
}
@@ -403,6 +407,8 @@ int Options::saveToFile (Glib::ustring fname) {
Glib::ArrayHandle<int> tpopen = tpOpen;
keyFile.set_integer_list ("GUI", "ToolPanelsExpanded", tpopen);
keyFile.set_integer ("GUI", "MultiDisplayMode", multiDisplayMode);
keyFile.set_double_list ("GUI", "CutOverlayBrush", cutOverlayBrush);
//Glib::ArrayHandle<int> crvopen = crvOpen;
//keyFile.set_integer_list ("GUI", "CurvePanelsExpanded", crvopen);

View File

@@ -133,9 +133,9 @@ class Options {
bool tabbedUI;
int previewSizeTab,previewSizeBrowser;
int multiDisplayMode; // 0=none, 1=Edit panels on other display
std::vector<double> cutOverlayBrush; // Red;Green;Blue;Alpha , all ranging 0..1
Options ();
Options ();
Options* copyFrom (Options* other);
void setDefaults ();