Fixed crash when using Spot WB on image edges issue 1903

This commit is contained in:
jdc
2013-12-21 08:01:37 +01:00
parent c3e790563f
commit a0a7efd4e7

View File

@@ -428,14 +428,21 @@ void ToolPanelCoordinator::spotWBselected (int x, int y, Thumbnail* thm) {
return; return;
// toolBar->setTool (TOOL_HAND); // toolBar->setTool (TOOL_HAND);
if (x>0 && y>0) { int rect=whitebalance->getSize ();
int ww= ipc->getFullWidth();
int hh= ipc->getFullHeight();
if (x-rect>0 && y-rect>0 && x+rect<ww && y+rect<hh) {
double temp; double temp;
double green; double green;
ipc->getSpotWB (x, y, whitebalance->getSize (), temp, green); ipc->getSpotWB (x, y, rect, temp, green);
whitebalance->setWB (temp, green); whitebalance->setWB (temp, green);
} }
} }
void ToolPanelCoordinator::autoCropRequested () { void ToolPanelCoordinator::autoCropRequested () {
if (!ipc) if (!ipc)