Added option for crop area color/opacy; See issue #355
This commit is contained in:
@@ -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);
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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 ();
|
||||
|
Reference in New Issue
Block a user