canvas-editor-engine 1.1.18 → 1.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,6 +14,7 @@ class VagueFilter extends filter_1.Filter {
|
|
|
14
14
|
return new Promise((resolve) => {
|
|
15
15
|
const options = this.options;
|
|
16
16
|
const imageData = this.copy(options);
|
|
17
|
+
// TODO: rewrite on pattern Strategies
|
|
17
18
|
const rowImageData = this[action](imageData, filterOptions);
|
|
18
19
|
this.update(rowImageData, options);
|
|
19
20
|
return resolve({
|
|
@@ -33,7 +34,9 @@ class VagueFilter extends filter_1.Filter {
|
|
|
33
34
|
pixel(imageData, filterOptions) {
|
|
34
35
|
const { quality } = filterOptions;
|
|
35
36
|
console.log('quality', quality);
|
|
37
|
+
// expansion strategy
|
|
36
38
|
const processedImageData = this.getQualityProcessedRemainder(imageData, +quality);
|
|
39
|
+
// TODO: add compression strategy and use register strategies;
|
|
37
40
|
const imageSize = {
|
|
38
41
|
width: processedImageData.width,
|
|
39
42
|
height: processedImageData.height,
|
|
@@ -27,7 +27,7 @@ class ThroughHistoryService {
|
|
|
27
27
|
}
|
|
28
28
|
;
|
|
29
29
|
static redo(ctx) {
|
|
30
|
-
const firstInCache = ThroughHistoryService.cache.shift();
|
|
30
|
+
const firstInCache = Object.assign(ThroughHistoryService.cache, {}).reverse().shift();
|
|
31
31
|
if (!!firstInCache?.stateValue) {
|
|
32
32
|
store_1.default.store.historyState.reduce('REDO', firstInCache);
|
|
33
33
|
ThroughHistoryService.updateCanvas(ctx, firstInCache.stateValue);
|