|
|
@ -1580,15 +1580,13 @@ function PaintWeb (win, doc) {
|
|
|
|
if (layerContext.getImageData) {
|
|
|
|
if (layerContext.getImageData) {
|
|
|
|
// TODO: handle "out of memory" errors.
|
|
|
|
// TODO: handle "out of memory" errors.
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
layerData = layerContext.getImageData(cropX, cropY, dataWidth,
|
|
|
|
layerData = layerContext.getImageData(cropX, cropY, dataWidth, dataHeight);
|
|
|
|
dataHeight);
|
|
|
|
|
|
|
|
} catch (err) { }
|
|
|
|
} catch (err) { }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (bufferContext.getImageData) {
|
|
|
|
if (bufferContext.getImageData) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
bufferData = bufferContext.getImageData(cropX, cropY, dataWidth,
|
|
|
|
bufferData = bufferContext.getImageData(cropX, cropY, dataWidth, dataHeight);
|
|
|
|
dataHeight);
|
|
|
|
|
|
|
|
} catch (err) { }
|
|
|
|
} catch (err) { }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1620,8 +1618,7 @@ function PaintWeb (win, doc) {
|
|
|
|
bufferState = layerState = layerData = bufferData = null;
|
|
|
|
bufferState = layerState = layerData = bufferData = null;
|
|
|
|
|
|
|
|
|
|
|
|
this.events.dispatch(new appEvent.imageSizeChange(cropWidth, cropHeight));
|
|
|
|
this.events.dispatch(new appEvent.imageSizeChange(cropWidth, cropHeight));
|
|
|
|
this.events.dispatch(new appEvent.canvasSizeChange(scaledWidth,
|
|
|
|
this.events.dispatch(new appEvent.canvasSizeChange(scaledWidth, scaledHeight, image.canvasScale));
|
|
|
|
scaledHeight, image.canvasScale));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// FIXME: 변경된 부분 : 변경된 내용이 없으면 skip
|
|
|
|
// FIXME: 변경된 부분 : 변경된 내용이 없으면 skip
|
|
|
@ -1770,8 +1767,7 @@ function PaintWeb (win, doc) {
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: in case of "out of memory" errors... I should show up some error.
|
|
|
|
// TODO: in case of "out of memory" errors... I should show up some error.
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
history.states.push(layerContext.getImageData(0, 0, this.image.width,
|
|
|
|
history.states.push(layerContext.getImageData(0, 0, this.image.width, this.image.height));
|
|
|
|
this.image.height));
|
|
|
|
|
|
|
|
} catch (err) {
|
|
|
|
} catch (err) {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1780,8 +1776,7 @@ function PaintWeb (win, doc) {
|
|
|
|
if ('historyLimit' in this.config &&
|
|
|
|
if ('historyLimit' in this.config &&
|
|
|
|
history.states.length > this.config.historyLimit) {
|
|
|
|
history.states.length > this.config.historyLimit) {
|
|
|
|
|
|
|
|
|
|
|
|
history.states.splice(0, history.states.length
|
|
|
|
history.states.splice(0, history.states.length - this.config.historyLimit);
|
|
|
|
- this.config.historyLimit);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
history.pos = history.states.length;
|
|
|
|
history.pos = history.states.length;
|
|
|
|
|
|
|
|
|
|
|
|