Skip to content

Commit

Permalink
fixes devforth#31
Browse files Browse the repository at this point in the history
  • Loading branch information
ivictbor committed Sep 25, 2019
1 parent 20b1a21 commit e2813a7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -156,8 +156,9 @@ Painterro({
|`availableFontSizes` | A list of the font size values that are available for selection in a drop down list e.g. `[1,2,4,8,16,64]`. Otherwise an input field is used. | undefined |
|`toolbarPosition` | Whether to position the toolbar at the top or bottom. | 'bottom' |
|`fixMobilePageReloader` | By default painterro adds overflow-y: hidden to page body on mobile devices to prevent "super smart" feature lice Chrom's reload page. Unfortunately we can't prevent it by preventDefault. If your want to scroll page when painterro is open, set this to false | true |
|`language` | Language of the widget. |'en'|
|`how_to_paste_actions`| List of paste options that will be suggested on paste using some paste dialog e.g. `['extend_right', 'extend_down'] `. If there is only one option in list, then it will choosing automatically without dialog| `['replace_all', 'paste_over', 'extend_right', 'extend_down']` |
|`language` | Language of the widget. | `'en'` |
|`how_to_paste_actions`| List of paste options that will be suggested on paste using some paste dialog e.g. `['extend_right', 'extend_down'] `. If there is only one option in list, then it will choosing automatically without dialog | `['replace_all', 'paste_over', 'extend_right', 'extend_down']` |
|`onCloseHandler` | If passed will be triggered when painterro closed | `null` |

UI color scheme
---------------
Expand Down
1 change: 1 addition & 0 deletions css/styles.css
Expand Up @@ -436,6 +436,7 @@ select.ptro-input {
overflow-y: hidden;
box-sizing: content-box;
line-height: normal;
text-align: left;
}

.ptro-text-tool-buttons {
Expand Down
7 changes: 4 additions & 3 deletions js/main.js
Expand Up @@ -612,8 +612,8 @@ class PainterroProc {
}

close() {
if (this.params.closeHandler !== undefined) {
this.params.closeHandler();
if (this.params.onCloseHandler !== undefined) {
this.params.onCloseHandler();
}
}

Expand Down Expand Up @@ -860,7 +860,8 @@ class PainterroProc {
if (this.listenersInstalled) {
return;
}
// passive: false fixes Unable to preventDefault inside passive event listener due to target being treated as passive
// passive: false fixes Unable to preventDefault inside passive event
// listener due to target being treated as passive
Object.keys(this.documentHandlers).forEach((key) => {
this.doc.addEventListener(key, this.documentHandlers[key], { passive: false });
});
Expand Down
6 changes: 4 additions & 2 deletions js/text.js
Expand Up @@ -222,12 +222,14 @@ export default class TextTool {
apply() {
const origBorder = this.input.style.border;
this.input.style.border = 'none';
const scale = this.main.getScale();
html2canvas(this.input, {
backgroundColor: null,
logging: false,
scale: 1 / this.main.zoomFactor,
scale: (1.0 * scale) / (this.main.zoomFactor),
}).then((can) => {
this.ctx.drawImage(can, this.scaledCord[0], this.scaledCord[1]);
console.log('!!! drawing image'); // eslint-disable-line
this.ctx.drawImage(can, this.scaledCord[0] + 1, this.scaledCord[1] + 1);
this.input.style.border = origBorder;
this.close();
this.main.worklog.captureState();
Expand Down

0 comments on commit e2813a7

Please sign in to comment.