diff --git a/rtdata/languages/default b/rtdata/languages/default index b023aa312..6af0b7374 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -594,6 +594,7 @@ TP_COLORSHIFT_GREENMAGENTA;Green-Magenta TP_COLORSHIFT_LABEL;Color Shift TP_CROP_DPI;DPI= TP_CROP_FIXRATIO;Fix Ratio: +TP_CROP_GTGRID;Grid TP_CROP_GTDIAGONALS;Rule of diagonals TP_CROP_GTHARMMEANS1;Harmonic means 1 TP_CROP_GTHARMMEANS2;Harmonic means 2 diff --git a/rtgui/crop.cc b/rtgui/crop.cc index 387ff7cdf..9b2efca0e 100644 --- a/rtgui/crop.cc +++ b/rtgui/crop.cc @@ -145,6 +145,7 @@ Crop::Crop () { guide->append_text (M("TP_CROP_GTHARMMEANS2")); guide->append_text (M("TP_CROP_GTHARMMEANS3")); guide->append_text (M("TP_CROP_GTHARMMEANS4")); + guide->append_text (M("TP_CROP_GTGRID")); guide->set_active (0); w->set_range (0, maxw); @@ -249,6 +250,8 @@ void Crop::read (const ProcParams* pp, const ParamsEdited* pedited) { guide->set_active (5); else if (pp->crop.guide == "Harmonic means 4") guide->set_active (6); + else if (pp->crop.guide == "Grid") + guide->set_active (7); x->set_value (pp->crop.x); y->set_value (pp->crop.y); @@ -334,6 +337,8 @@ void Crop::write (ProcParams* pp, ParamsEdited* pedited) { pp->crop.guide = "Harmonic means 3"; else if (guide->get_active_row_number()==6) pp->crop.guide = "Harmonic means 4"; + else if (guide->get_active_row_number()==7) + pp->crop.guide = "Grid"; if (pedited) { pedited->crop.enabled = !enabled->get_inconsistent(); diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index 7702031ae..6f53c8fca 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -1,7 +1,6 @@ /* * This file is part of RawTherapee. * - * Copyright (c) 2004-2010 Gabor Horvath * * RawTherapee is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -65,7 +64,7 @@ Glib::ustring getExtension (const Glib::ustring& filename) { void drawCrop (Cairo::RefPtr cr, int imx, int imy, int imw, int imh, int startx, int starty, double scale, const rtengine::procparams::CropParams& cparams) { - cr->set_line_width (1.0); + cr->set_line_width (0.7); cr->rectangle (imx+0.5, imy+0.5, imw, imh); cr->clip (); @@ -136,11 +135,30 @@ void drawCrop (Cairo::RefPtr cr, int imx, int imy, int imw, int else if (cparams.guide=="Harmonic means 4") { horiz_ratios.push_back (0.618); vert_ratios.push_back (0.618); - } - for (int i=0; ilongSideNumLines && h>longSideNumLines) { + if (w>h) { + for (int i=1;iset_source_rgb (1.0, 1.0, 1.0); - cr->move_to (rectx1 + (rectx2-rectx1) * vert_ratios[i], recty1); - cr->line_to (rectx1 + (rectx2-rectx1) * vert_ratios[i], recty2); cr->move_to (rectx1, recty1 + (recty2-recty1) * horiz_ratios[i]); cr->line_to (rectx2, recty1 + (recty2-recty1) * horiz_ratios[i]); cr->stroke (); @@ -148,13 +166,27 @@ void drawCrop (Cairo::RefPtr cr, int imx, int imy, int imw, int std::valarray ds (1); ds[0] = 4; cr->set_dash (ds, 0); - cr->move_to (rectx1 + (rectx2-rectx1) * vert_ratios[i], recty1); - cr->line_to (rectx1 + (rectx2-rectx1) * vert_ratios[i], recty2); cr->move_to (rectx1, recty1 + (recty2-recty1) * horiz_ratios[i]); cr->line_to (rectx2, recty1 + (recty2-recty1) * horiz_ratios[i]); cr->stroke (); ds.resize (0); cr->set_dash (ds, 0); + } + // Verticals + for (int i=0; iset_source_rgb (1.0, 1.0, 1.0); + cr->move_to (rectx1 + (rectx2-rectx1) * vert_ratios[i], recty1); + cr->line_to (rectx1 + (rectx2-rectx1) * vert_ratios[i], recty2); + cr->stroke (); + cr->set_source_rgb (0.0, 0.0, 0.0); + std::valarray ds (1); + ds[0] = 4; + cr->set_dash (ds, 0); + cr->move_to (rectx1 + (rectx2-rectx1) * vert_ratios[i], recty1); + cr->line_to (rectx1 + (rectx2-rectx1) * vert_ratios[i], recty2); + cr->stroke (); + ds.resize (0); + cr->set_dash (ds, 0); } } else {