diff --git a/CMakeLists.txt b/CMakeLists.txt index 30721a43c..685b418bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -224,9 +224,9 @@ endif() if(NOT DEFINED APPDATADIR) if(UNIX) if(BUILD_BUNDLE) - set(APPDATADIR "${DATADIR}/share/appdata") + set(APPDATADIR "${DATADIR}/share/metainfo") else() - set(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share/appdata") + set(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share/metainfo") endif() endif() endif() diff --git a/rawtherapee.appdata.xml b/rawtherapee.appdata.xml index 3bcab8918..c1a1bf6a7 100644 --- a/rawtherapee.appdata.xml +++ b/rawtherapee.appdata.xml @@ -1,6 +1,6 @@ - + rawtherapee.desktop CC-BY-SA-4.0 GPL-3.0+ @@ -15,13 +15,27 @@

- http://rawpedia.rawtherapee.com/images/9/99/Rt-5-misty1.jpg - http://rawpedia.rawtherapee.com/images/2/2f/Rt-5-cc24-lcp.jpg - http://rawtherapee.com/images/screenshots/rt-42_07-hdr-landscape.jpg - http://rawtherapee.com/images/screenshots/rt-42_03-macro-detail-toning.jpg - http://rawtherapee.com/images/screenshots/rt-42_05-cow-bw-toning.jpg - http://rawtherapee.com/images/screenshots/rt-42_08-fb-metadata.jpg - http://rawtherapee.com/images/screenshots/rt-42_09-queue.jpg + + http://rawpedia.rawtherapee.com/images/9/99/Rt-5-misty1.jpg + + + http://rawpedia.rawtherapee.com/images/2/2f/Rt-5-cc24-lcp.jpg + + + http://rawtherapee.com/images/screenshots/rt-42_07-hdr-landscape.jpg + + + http://rawtherapee.com/images/screenshots/rt-42_03-macro-detail-toning.jpg + + + http://rawtherapee.com/images/screenshots/rt-42_05-cow-bw-toning.jpg + + + http://rawtherapee.com/images/screenshots/rt-42_08-fb-metadata.jpg + + + http://rawtherapee.com/images/screenshots/rt-42_09-queue.jpg + raw @@ -31,5 +45,5 @@ graphics http://rawtherapee.com/ - contactus_at_rawtherapee.com -
+ contactus@rawtherapee.com + diff --git a/rtdata/languages/default b/rtdata/languages/default index 894d513f0..23d12e1be 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2135,3 +2135,5 @@ ZOOMPANEL_ZOOMFITCROPSCREEN;Fit crop to screen\nShortcut: Alt-f ZOOMPANEL_ZOOMFITSCREEN;Fit whole image to screen\nShortcut: f ZOOMPANEL_ZOOMIN;Zoom In\nShortcut: + ZOOMPANEL_ZOOMOUT;Zoom Out\nShortcut: - +GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. +DONT_SHOW_AGAIN;Don't show this message again. diff --git a/rtdata/options/options.osx b/rtdata/options/options.osx index 4d35255cd..25696cb85 100644 --- a/rtdata/options/options.osx +++ b/rtdata/options/options.osx @@ -23,9 +23,6 @@ PathTemplate=%p1/converted/%f # Parameters: CustomProfileBuilder= -[GUI] -Font=Sans 12 - # Set here an absolute or relative path (to the rawtherapee.exe file) to the directory containing your own profiles. # If MultiUser=true, each user will have their own "options" file, and can set a common or different absolu path #Directory=profiles @@ -39,3 +36,7 @@ Font=Sans 12 # Default profile name (without extension) to use for standard (8bits) images #ImgDefault=Neutral + +[GUI] +FontFamily=Helvetica Regular +CPFontFamily=Helvetica Regular diff --git a/rtengine/ipresize.cc b/rtengine/ipresize.cc index dde43fe6c..644e180c7 100644 --- a/rtengine/ipresize.cc +++ b/rtengine/ipresize.cc @@ -18,9 +18,12 @@ */ #include "improcfun.h" + +#include "alignedbuffer.h" +#include "opthelper.h" #include "rt_math.h" #include "sleef.c" -#include "opthelper.h" + //#define PROFILE #ifdef PROFILE @@ -180,9 +183,9 @@ SSEFUNCTION void ImProcFunctions::Lanczos (const LabImage* src, LabImage* dst, f const int support = static_cast (2.0f * a / sc) + 1; // storage for precomputed parameters for horizontal interpolation - float * wwh = new float[support * dst->W]; - int * jj0 = new int[dst->W]; - int * jj1 = new int[dst->W]; + float* const wwh = new float[support * dst->W]; + int* const jj0 = new int[dst->W]; + int* const jj1 = new int[dst->W]; // Phase 1: precompute coefficients for horizontal interpolation for (int j = 0; j < dst->W; j++) { @@ -218,9 +221,12 @@ SSEFUNCTION void ImProcFunctions::Lanczos (const LabImage* src, LabImage* dst, f #endif { // temporal storage for vertically-interpolated row of pixels - float * lL = new float[src->W]; - float * la = new float[src->W]; - float * lb = new float[src->W]; + AlignedBuffer aligned_buffer_ll(src->W); + AlignedBuffer aligned_buffer_la(src->W); + AlignedBuffer aligned_buffer_lb(src->W); + float* const lL = aligned_buffer_ll.data; + float* const la = aligned_buffer_la.data; + float* const lb = aligned_buffer_lb.data; // weights for interpolation in y direction float w[support] ALIGNED64; @@ -315,10 +321,6 @@ SSEFUNCTION void ImProcFunctions::Lanczos (const LabImage* src, LabImage* dst, f dst->b[i][j] = b; } } - - delete[] lL; - delete[] la; - delete[] lb; } delete[] jj0; delete[] jj1; diff --git a/rtengine/rawimage.cc b/rtengine/rawimage.cc index 7b6ee8782..f36e798d9 100644 --- a/rtengine/rawimage.cc +++ b/rtengine/rawimage.cc @@ -112,7 +112,7 @@ void RawImage::get_colorsCoeff( float *pre_mul_, float *scale_mul_, float *cblac } } - if ( this->get_cam_mul(0) == -1 || forceAutoWB) { + if (data && (this->get_cam_mul(0) == -1 || forceAutoWB)) { memset(dsum, 0, sizeof dsum); if (this->isBayer()) { @@ -552,7 +552,7 @@ int RawImage::loadRaw (bool loadData, unsigned int imageNum, bool closeFile, Pro crop_masked_pixels(); free (raw_image); raw_image = nullptr; - } else { + } else { if (get_maker() == "Sigma" && cc && cc->has_rawCrop()) { // foveon images int lm, tm, w, h; cc->get_rawCrop(lm, tm, w, h); diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 389c16a4e..8d2d6251a 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -1901,10 +1901,10 @@ bool EditorPanel::saveImmediately(const Glib::ustring &filename, const SaveForma { rtengine::procparams::ProcParams pparams; ipc->getParams (&pparams); - std::unique_ptr job(rtengine::ProcessingJob::create (ipc->getInitialImage(), pparams)); + rtengine::ProcessingJob *job = rtengine::ProcessingJob::create(ipc->getInitialImage(), pparams); // save immediately - rtengine::IImage16 *img = rtengine::processImage(job.get(), err, nullptr, options.tunnelMetaData, false); + rtengine::IImage16 *img = rtengine::processImage(job, err, nullptr, options.tunnelMetaData, false); int err = 0; if (sf.format == "tif") { diff --git a/rtgui/main.cc b/rtgui/main.cc index 099751f06..455749fdd 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -254,6 +254,12 @@ RTWindow *create_rt_window() Gtk::Settings::get_for_screen(screen)->property_gtk_theme_name() = "Adwaita"; Gtk::Settings::get_for_screen(screen)->property_gtk_application_prefer_dark_theme() = true; +#if defined(__APPLE__) + // This will force screen resolution regarding font, but I don't think it's compliant with Gtk guidelines... + // Do not confuse with screen scaling, where everything is scaled up ! + screen->set_resolution (96.); +#endif + Glib::RefPtr regex = Glib::Regex::create(THEMEREGEXSTR, Glib::RegexCompileFlags::REGEX_CASELESS); Glib::ustring filename = Glib::build_filename(argv0, "themes", options.theme + ".css"); if (!regex->match(options.theme + ".css") || !Glib::file_test(filename, Glib::FILE_TEST_EXISTS)) { @@ -410,6 +416,19 @@ private: RTWindow *rtWindow; }; +void show_gimp_plugin_info_dialog(Gtk::Window *parent) +{ + if (options.gimpPluginShowInfoDialog) { + Gtk::MessageDialog info(*parent, M("GIMP_PLUGIN_INFO"), false, Gtk::MESSAGE_INFO, Gtk::BUTTONS_OK, true); + Gtk::Box *box = info.get_message_area(); + Gtk::CheckButton dontshowagain(M("DONT_SHOW_AGAIN")); + dontshowagain.show(); + box->pack_start(dontshowagain); + info.run(); + options.gimpPluginShowInfoDialog = !dontshowagain.get_active(); + } +} + } // namespace @@ -596,6 +615,9 @@ int main(int argc, char **argv) Gtk::Main m(&argc, &argv); gdk_threads_enter(); const std::unique_ptr rtWindow(create_rt_window()); + if (gimpPlugin) { + show_gimp_plugin_info_dialog(rtWindow.get()); + } m.run(*rtWindow); gdk_threads_leave(); diff --git a/rtgui/options.cc b/rtgui/options.cc index 9fa47b226..402fb5bb5 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -511,117 +511,117 @@ void Options::setDefaults () // Reminder: 0 = SET mode, 1 = ADD mode baBehav = { - 0, // ADDSET_TC_EXPCOMP - 0, // ADDSET_TC_BRIGHTNESS - 0, // ADDSET_TC_BLACKLEVEL - 0, // ADDSET_TC_CONTRAST - 0, // ADDSET_SH_HIGHLIGHTS - 0, // ADDSET_SH_SHADOWS - 0, // ADDSET_SH_LOCALCONTRAST - 0, // ADDSET_LC_BRIGHTNESS - 0, // ADDSET_LC_CONTRAST - 0, // ADDSET_SHARP_AMOUNT - 0, // ADDSET_WB_TEMPERATURE - 0, // ADDSET_WB_GREEN - 0, // ADDSET_ROTATE_DEGREE - 0, // ADDSET_DIST_AMOUNT - 0, // ADDSET_PERSPECTIVE - 0, // ADDSET_CA - 0, // ADDSET_VIGN_AMOUNT - 0, // ADDSET_VIGN_RADIUS - 0, // ADDSET_VIGN_STRENGTH - 0, // ADDSET_VIGN_CENTER - 0, // ADDSET_LC_CHROMATICITY - 0, // ADDSET_TC_SATURATION - 0, // ADDSET_TC_HLCOMPAMOUNT - 0, // ADDSET_TC_HLCOMPTHRESH - 0, // ADDSET_TC_SHCOMP - 0, // ADDSET_DIRPYREQ - 0, // ADDSET_DIRPYRDN_LUMA - 0, // ADDSET_DIRPYRDN_LUDET - 0, // ADDSET_DIRPYRDN_CHROMA - 0, // ADDSET_DIRPYRDN_CHROMARED - 0, // ADDSET_DIRPYRDN_CHROMABLUE - 0, // ADDSET_DIRPYRDN_GAMMA - 0, // ADDSET_CHMIXER - 0, // ADDSET_PREPROCESS_GREENEQUIL - 0, // ADDSET_PREPROCESS_LINEDENOISE - 0, // ADDSET_RAWCACORR - 0, // ADDSET_RAWEXPOS_LINEAR - 0, // ADDSET_RAWEXPOS_PRESER - 0, // ADDSET_RAWEXPOS_BLACKS - 0, // ADDSET_SHARPENEDGE_AMOUNT - 0, // ADDSET_SHARPENMICRO_AMOUNT - 0, // ADDSET_SHARPENEDGE_PASS - 0, // ADDSET_SHARPENMICRO_UNIFORMITY - 0, // ADDSET_VIBRANCE_PASTELS - 0, // ADDSET_VIBRANCE_SATURATED - 0, // ADDSET_FREE_OUPUT_GAMMA - 0, // ADDSET_FREE_OUTPUT_SLOPE - 0, // ADDSET_CAT_DEGREE - 0, // ADDSET_CAT_ADAPSCEN - 0, // ADDSET_CAT_ADAPLUM - 0, // ADDSET_CAT_LIGHT - 0, // ADDSET_CAT_RSTPRO - 0, // ADDSET_CAT_BADPIX - 0, // ADDSET_CAT_JLIGHT - 0, // ADDSET_CAT_CHROMA - 0, // ADDSET_CAT_CONTRAST - 0, // ADDSET_CAT_CHROMA_S - 0, // ADDSET_CAT_CHROMA_M - 0, // ADDSET_CAT_HUE - 0, // ADDSET_CAT_BADPIX - 0, // ADDSET_WB_EQUAL - 0, // ADDSET_GRADIENT_DEGREE - 0, // ADDSET_GRADIENT_FEATHER - 0, // ADDSET_GRADIENT_STRENGTH - 0, // ADDSET_GRADIENT_CENTER - 0, // ADDSET_PCVIGNETTE_STRENGTH - 0, // ADDSET_PCVIGNETTE_FEATHER - 0, // ADDSET_PCVIGNETTE_ROUNDNESS - 0, // ADDSET_BLACKWHITE_HUES - 0, // ADDSET_BLACKWHITE_GAMMA - 0, // ADDSET_DIRPYREQ_THRESHOLD - 0, // ADDSET_DIRPYREQ_SKINPROTECT - 0, // ADDSET_COLORTONING_SPLIT - 0, // ADDSET_COLORTONING_SATTHRESHOLD - 0, // ADDSET_COLORTONING_SATOPACITY - 0, // ADDSET_COLORTONING_BALANCE - 0, // ADDSET_COLORTONING_STRENGTH - 0, // ADDSET_DIRPYRDN_PASSES - 0, // ADDSET_RAWFFCLIPCONTROL - 0, // ADDSET_FILMSIMULATION_STRENGTH - 0, // ADDSET_WA - 0, // ADDSET_WA_SKINPROTECT - 0, // ADDSET_WA_THRESHOLD2 - 0, // ADDSET_WA_THRR - 0, // ADDSET_WA_THRRH - 0, // ADDSET_WA_THRESHOLD - 0, // ADDSET_WA_THRESHOLD2 - 0, // ADDSET_WA_CHRO - 0, // ADDSET_WA_CHROMA - 0, // ADDSET_WA_CONTRAST - 0, // ADDSET_WA_RESCON - 0, // ADDSET_WA_RESCONH - 0, // ADDSET_WA_RESCHRO - 0, // ADDSET_WA_SKYPROTECT - 0, // ADDSET_WA_EDGRAD - 0, // ADDSET_WA_EDGVAL - 0, // ADDSET_WA_STRENGTH - 0, // ADDSET_WA_EDGEDETECT - 0, // ADDSET_WA_EDGEDETECTTHR - 0, // ADDSET_WA_EDGEDETECTTHR2 - 0, // ADDSET_WA_TMRS - 0, // ADDSET_WA_GAMMA - 0, // ADDSET_RETI_STR - 0, // ADDSET_RETI_NEIGH - 0, // ADDSET_RETI_LIMD - 0, // ADDSET_RETI_GAIN - 0, // ADDSET_RETI_OFFS - 0, // ADDSET_RETI_VART - 0, // ADDSET_RETI_GAM - 0, // ADDSET_RETI_SLO - 0, // ADDSET_WB_TEMPBIAS + 1, // ADDSET_TC_EXPCOMP + 1, // ADDSET_TC_BRIGHTNESS + 1, // ADDSET_TC_BLACKLEVEL + 1, // ADDSET_TC_CONTRAST + 1, // ADDSET_SH_HIGHLIGHTS + 1, // ADDSET_SH_SHADOWS + 1, // ADDSET_SH_LOCALCONTRAST + 1, // ADDSET_LC_BRIGHTNESS + 1, // ADDSET_LC_CONTRAST + 1, // ADDSET_SHARP_AMOUNT + 1, // ADDSET_WB_TEMPERATURE + 1, // ADDSET_WB_GREEN + 1, // ADDSET_ROTATE_DEGREE + 1, // ADDSET_DIST_AMOUNT + 1, // ADDSET_PERSPECTIVE + 1, // ADDSET_CA + 1, // ADDSET_VIGN_AMOUNT + 1, // ADDSET_VIGN_RADIUS + 1, // ADDSET_VIGN_STRENGTH + 1, // ADDSET_VIGN_CENTER + 1, // ADDSET_LC_CHROMATICITY + 1, // ADDSET_TC_SATURATION + 1, // ADDSET_TC_HLCOMPAMOUNT + 1, // ADDSET_TC_HLCOMPTHRESH + 1, // ADDSET_TC_SHCOMP + 1, // ADDSET_DIRPYREQ + 1, // ADDSET_DIRPYRDN_LUMA + 1, // ADDSET_DIRPYRDN_LUDET + 1, // ADDSET_DIRPYRDN_CHROMA + 1, // ADDSET_DIRPYRDN_CHROMARED + 1, // ADDSET_DIRPYRDN_CHROMABLUE + 1, // ADDSET_DIRPYRDN_GAMMA + 1, // ADDSET_CHMIXER + 1, // ADDSET_PREPROCESS_GREENEQUIL + 1, // ADDSET_PREPROCESS_LINEDENOISE + 1, // ADDSET_RAWCACORR + 1, // ADDSET_RAWEXPOS_LINEAR + 1, // ADDSET_RAWEXPOS_PRESER + 1, // ADDSET_RAWEXPOS_BLACKS + 1, // ADDSET_SHARPENEDGE_AMOUNT + 1, // ADDSET_SHARPENMICRO_AMOUNT + 1, // ADDSET_SHARPENEDGE_PASS + 1, // ADDSET_SHARPENMICRO_UNIFORMITY + 1, // ADDSET_VIBRANCE_PASTELS + 1, // ADDSET_VIBRANCE_SATURATED + 1, // ADDSET_FREE_OUPUT_GAMMA + 1, // ADDSET_FREE_OUTPUT_SLOPE + 1, // ADDSET_CAT_DEGREE + 1, // ADDSET_CAT_ADAPSCEN + 1, // ADDSET_CAT_ADAPLUM + 1, // ADDSET_CAT_LIGHT + 1, // ADDSET_CAT_RSTPRO + 1, // ADDSET_CAT_BADPIX + 1, // ADDSET_CAT_JLIGHT + 1, // ADDSET_CAT_CHROMA + 1, // ADDSET_CAT_CONTRAST + 1, // ADDSET_CAT_CHROMA_S + 1, // ADDSET_CAT_CHROMA_M + 1, // ADDSET_CAT_HUE + 1, // ADDSET_CAT_BADPIX + 1, // ADDSET_WB_EQUAL + 1, // ADDSET_GRADIENT_DEGREE + 1, // ADDSET_GRADIENT_FEATHER + 1, // ADDSET_GRADIENT_STRENGTH + 1, // ADDSET_GRADIENT_CENTER + 1, // ADDSET_PCVIGNETTE_STRENGTH + 1, // ADDSET_PCVIGNETTE_FEATHER + 1, // ADDSET_PCVIGNETTE_ROUNDNESS + 1, // ADDSET_BLACKWHITE_HUES + 1, // ADDSET_BLACKWHITE_GAMMA + 1, // ADDSET_DIRPYREQ_THRESHOLD + 1, // ADDSET_DIRPYREQ_SKINPROTECT + 1, // ADDSET_COLORTONING_SPLIT + 1, // ADDSET_COLORTONING_SATTHRESHOLD + 1, // ADDSET_COLORTONING_SATOPACITY + 1, // ADDSET_COLORTONING_BALANCE + 1, // ADDSET_COLORTONING_STRENGTH + 1, // ADDSET_DIRPYRDN_PASSES + 1, // ADDSET_RAWFFCLIPCONTROL + 1, // ADDSET_FILMSIMULATION_STRENGTH + 1, // ADDSET_WA + 1, // ADDSET_WA_SKINPROTECT + 1, // ADDSET_WA_THRESHOLD2 + 1, // ADDSET_WA_THRR + 1, // ADDSET_WA_THRRH + 1, // ADDSET_WA_THRESHOLD + 1, // ADDSET_WA_THRESHOLD2 + 1, // ADDSET_WA_CHRO + 1, // ADDSET_WA_CHROMA + 1, // ADDSET_WA_CONTRAST + 1, // ADDSET_WA_RESCON + 1, // ADDSET_WA_RESCONH + 1, // ADDSET_WA_RESCHRO + 1, // ADDSET_WA_SKYPROTECT + 1, // ADDSET_WA_EDGRAD + 1, // ADDSET_WA_EDGVAL + 1, // ADDSET_WA_STRENGTH + 1, // ADDSET_WA_EDGEDETECT + 1, // ADDSET_WA_EDGEDETECTTHR + 1, // ADDSET_WA_EDGEDETECTTHR2 + 1, // ADDSET_WA_TMRS + 1, // ADDSET_WA_GAMMA + 1, // ADDSET_RETI_STR + 1, // ADDSET_RETI_NEIGH + 1, // ADDSET_RETI_LIMD + 1, // ADDSET_RETI_GAIN + 1, // ADDSET_RETI_OFFS + 1, // ADDSET_RETI_VART + 1, // ADDSET_RETI_GAM + 1, // ADDSET_RETI_SLO + 1, // ADDSET_WB_TEMPBIAS }; rtSettings.darkFramesPath = ""; @@ -724,6 +724,7 @@ void Options::setDefaults () lastProfilingReferenceDir = ""; lastBWCurvesDir = ""; lastLensProfileDir = ""; + gimpPluginShowInfoDialog = true; maxRecentFolders = 15; } @@ -1852,6 +1853,9 @@ int Options::readFromFile (Glib::ustring fname) safeDirGet (keyFile, "Dialogs", "LastVibranceCurvesDir", lastVibranceCurvesDir); safeDirGet (keyFile, "Dialogs", "LastProfilingReferenceDir", lastProfilingReferenceDir); safeDirGet (keyFile, "Dialogs", "LastLensProfileDir", lastLensProfileDir); + if (keyFile.has_key ("Dialogs", "GimpPluginShowInfoDialog")) { + gimpPluginShowInfoDialog = keyFile.get_boolean("Dialogs", "GimpPluginShowInfoDialog"); + } } // -------------------------------------------------------------------------------------------------------- @@ -2217,6 +2221,7 @@ int Options::saveToFile (Glib::ustring fname) keyFile.set_string ("Dialogs", "LastVibranceCurvesDir", lastVibranceCurvesDir); keyFile.set_string ("Dialogs", "LastProfilingReferenceDir", lastProfilingReferenceDir); keyFile.set_string ("Dialogs", "LastLensProfileDir", lastLensProfileDir); + keyFile.set_boolean("Dialogs", "GimpPluginShowInfoDialog", gimpPluginShowInfoDialog); keyData = keyFile.to_data (); diff --git a/rtgui/options.h b/rtgui/options.h index 9253b7e2f..13025ee7c 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -315,6 +315,7 @@ public: Glib::ustring lastProfilingReferenceDir; Glib::ustring lastBWCurvesDir; Glib::ustring lastLensProfileDir; + bool gimpPluginShowInfoDialog; size_t maxRecentFolders; // max. number of recent folders stored in options file std::vector recentFolders; // List containing all recent folders diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 2f9ab7f1a..1cdd8ae39 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -2020,16 +2020,15 @@ void Preferences::fillPreferences () addc.block (true); setc.block (true); - if (moptions.baBehav.size() == ADDSET_PARAM_NUM) { - for (size_t i = 0; i < moptions.baBehav.size(); i++) - for (Gtk::TreeIter sections = behModel->children().begin(); sections != behModel->children().end(); sections++) - for (Gtk::TreeIter adjs = sections->children().begin(); adjs != sections->children().end(); adjs++) - if (adjs->get_value (behavColumns.addsetid) == (int)i) { - adjs->set_value (behavColumns.badd, moptions.baBehav[i] == 1); - adjs->set_value (behavColumns.bset, moptions.baBehav[i] != 1); - break; - } - } + moptions.baBehav.resize (ADDSET_PARAM_NUM); + for (size_t i = 0; i < moptions.baBehav.size(); i++) + for (Gtk::TreeIter sections = behModel->children().begin(); sections != behModel->children().end(); sections++) + for (Gtk::TreeIter adjs = sections->children().begin(); adjs != sections->children().end(); adjs++) + if (adjs->get_value (behavColumns.addsetid) == (int)i) { + adjs->set_value (behavColumns.badd, moptions.baBehav[i] == 1); + adjs->set_value (behavColumns.bset, moptions.baBehav[i] != 1); + break; + } addc.block (false); setc.block (false); diff --git a/rtgui/previewwindow.cc b/rtgui/previewwindow.cc index 66f49f61e..015c30d4c 100644 --- a/rtgui/previewwindow.cc +++ b/rtgui/previewwindow.cc @@ -211,16 +211,15 @@ bool PreviewWindow::on_motion_notify_event (GdkEventMotion* event) int x, y, w, h; getObservedFrameArea (x, y, w, h); if (x>imgX || y>imgY || w < imgW || h < imgH) { - bool inside = event->x > x - 6 && event->x < x + w - 1 + 6 && event->y > y - 6 && event->y < y + h - 1 + 6; - bool moreInside = event->x > x + 6 && event->x < x + w - 1 - 6 && event->y > y + 6 && event->y < y + h - 1 - 6; + bool inside = event->x > x - 6 && event->x < x + w - 1 + 6 && event->y > y - 6 && event->y < y + h - 1 + 6; CursorShape newType = cursor_type; if (isMoving) { - mainCropWin->remoteMove ((event->x - press_x) / zoom, (event->y - press_y) / zoom); + mainCropWin->remoteMove ((int)((event->x - (double)press_x) / zoom), (int)((event->y - (double)press_y) / zoom)); press_x = event->x; press_y = event->y; - } else if (inside && !moreInside) { + } else if (inside) { newType = CSClosedHand; } else { newType = CSArrow; @@ -247,18 +246,10 @@ bool PreviewWindow::on_button_press_event (GdkEventButton* event) if (x>imgX || y>imgY || w < imgW || h < imgH) { if (!isMoving) { - bool inside = event->x > x - 6 && event->x < x + w - 1 + 6 && event->y > y - 6 && event->y < y + h - 1 + 6; - bool moreInside = event->x > x + 6 && event->x < x + w - 1 - 6 && event->y > y + 6 && event->y < y + h - 1 - 6; isMoving = true; - if (!inside || moreInside) { - mainCropWin->remoteMove ((event->x - (x + w / 2)) / zoom, (event->y - (y + h / 2)) / zoom); - press_x = x + w / 2; - press_y = y + h / 2; - } else { - press_x = event->x; - press_y = event->y; - } + press_x = event->x; + press_y = event->y; if (cursor_type != CSClosedHand) { cursor_type = CSClosedHand;