-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Editor] - Add the ability to directly draw after selecting ink tool #15050
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me, with comments addressed (mostly grammar nits) and passing tests; thank you!
// We want to have the ink editor covering all the page | ||
// and no click to create it: it must be here when we start to draw. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// We want to have the ink editor covering all the page | |
// and no click to create it: it must be here when we start to draw. | |
// We want to have the ink editor covering all of the page without having | |
// to click to create it: it must be here when we start to draw. |
} | ||
|
||
/** | ||
* mouseover callback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* mouseover callback. | |
* Mouseover callback. |
// The div is the target so there is no ink editor, hence we can | ||
// create a new one. | ||
// event.buttons === 0 is here to avoid adding a new ink editor | ||
// when we drop and editor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you actually mean the following?
// when we drop and editor. | |
// when we drop an editor. |
* @param {boolean} mustExec - if true the command is executed after having | ||
* been added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that this is optional:
* @param {boolean} mustExec - if true the command is executed after having | |
* been added. | |
* @param {boolean} [mustExec] - If true the command is executed after having | |
* been added. |
*/ | ||
addCommands(cmd, undo) { | ||
this.#uiManager.addCommands(cmd, undo); | ||
addCommands(cmd, undo, mustExec = true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to another recent PR, can we please have the default value be false
instead?
(Since having undefined
=> true
feels quite surprising.)
src/display/editor/ink.js
Outdated
// This editor must be on top of the main ink | ||
// editor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Fits on one line.
src/display/editor/ink.js
Outdated
// Since it the last children there is no need to give | ||
// a higher z-index. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Since it the last children there is no need to give | |
// a higher z-index. | |
// Since it's the last child, there's no need to give it a higher z-index. |
src/display/editor/ink.js
Outdated
// Since the ink editor covers all the page and we | ||
// want to be able to select an other editor, we | ||
// just put this one in background. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Since the ink editor covers all the page and we | |
// want to be able to select an other editor, we | |
// just put this one in background. | |
// Since the ink editor covers all of the page and we want to be able | |
// to select another editor, we just put this one in the background. |
src/display/editor/tools.js
Outdated
*/ | ||
addCommands(cmd, undo) { | ||
this.#commandManager.add(cmd, undo); | ||
addCommands(cmd, undo, mustExec = true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to another recent PR, can we please have the default value be false
instead?
(Since having undefined
=> true
feels quite surprising.)
*/ | ||
add(cmd, undo) { | ||
add(cmd, undo, mustExec) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please mark the new parameter as optional with mustExec = false
m and also indicate that in the JSDoc (using * @param {boolean} [mustExec]
).
- Right now, we must select the tool, then click to select a page and click to start drawing and it's a bit painful; - so just create a new ink editor when we're hovering a page without one.
bca75a9
to
e7dc1ef
Compare
/botio unittest |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/6d64997aaa346b7/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/fe0f6e31978ce32/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/6d64997aaa346b7/output.txt Total script time: 3.16 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/fe0f6e31978ce32/output.txt Total script time: 6.26 mins
|
/botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/8735927338ade28/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/30175c2f8a70079/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/8735927338ade28/output.txt Total script time: 4.47 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/30175c2f8a70079/output.txt Total script time: 7.30 mins
|
click to start drawing and it's a bit painful;