Skip to content

Commit

Permalink
make redo hidden by default, add image.getWidth(), image.getHeight()
Browse files Browse the repository at this point in the history
  • Loading branch information
ivictbor committed Sep 27, 2019
1 parent 2560c99 commit 6cd0038
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ Events accepted arguments:
asBlob: ƒ asBlob(type, quality)
asDataURL: ƒ asDataURL(type, quality)
suggestedFileName: ƒ suggestedFileName(type)
getWidth: ƒ getWidth()
getHeight: ƒ getHeight()
}
operationsDone: int
}
Expand Down
4 changes: 3 additions & 1 deletion build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@
availableFontSizes: [1,2,4,8,16,64],
availableArrowLengths: [10,20,30,40,50,60],
// how_to_paste_actions: ['replace_all'],

saveHandler: (saver) => {
console.log('saving', saver.getWidth(), saver.getHeight())
}
//toolbarPosition: 'top',
// fixMobilePageReloader: false,
// defaultTool: 'line',
Expand Down
2 changes: 2 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,8 @@ class PainterroProc {
}
return `${(this.loadedName || `image-${genId()}`)}.${realType}`;
},
getWidth: () => this.size.w,
getHeight: () => this.size.h,
};

this.initEventHandlers();
Expand Down
2 changes: 1 addition & 1 deletion js/params.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function setDefaults(parameters) {
params.worklogLimit = firstDefined(params.worklogLimit, 100);

params.defaultTool = params.defaultTool || 'select';
params.hiddenTools = params.hiddenTools || [];
params.hiddenTools = params.hiddenTools || ['redo'];
const defaultInHiddenIndex = params.hiddenTools.indexOf(params.defaultTool);
if (defaultInHiddenIndex > -1) {
logError(`Can't hide default tool '${params.defaultTool}', please change default tool to another to hide it`);
Expand Down

0 comments on commit 6cd0038

Please sign in to comment.