On preview widgets for the Gradient tool (center & angle). Also includes some rudimentary bounds checking (optional) when accessing some kind of array.

This commit is contained in:
Hombre
2014-02-18 02:14:27 +01:00
parent 315676aeb0
commit 8d70ca0f41
17 changed files with 1338 additions and 173 deletions

View File

@@ -23,6 +23,7 @@
#include "rt_math.h"
#include "colortemp.h"
// "ceil" rounding
#define SKIPS(a,b) ((a) / (b) + ((a) % (b) > 0))
namespace rtengine {
@@ -95,6 +96,13 @@ void Crop::setEditSubscriber(EditSubscriber* newSubscriber) {
EditBuffer::singlePlaneBuffer.flushData();
}
}
if (newSubscriber == NULL && oldSubscriber != NULL && oldSubscriber->getEditingType() == ET_OBJECTS) {
printf("Free object buffers\n");
EditBuffer::resize(0, 0); // This will delete the objects buffer
}
else if (newSubscriber && newSubscriber->getEditingType() == ET_OBJECTS) {
EditBuffer::resize(cropw, croph, newSubscriber);
}
// If oldSubscriber == NULL && newSubscriber != NULL -> the image will be allocated when necessary
}