-
Notifications
You must be signed in to change notification settings - Fork 219
[[ Bug 16032 ]] gradientrampeditor widget does not catch mouse relea… #2930
Conversation
…e outside card bounds gradientrampeditor does not catch mouseUp when it occurs outside of card bounds. Added OnMouseCancel handler.
📝 Hi @BerndN, I haven't been able to verify that you've signed our LiveCode Contributor's Agreement. If you have previously signed the Contributor's Agreement, I may not be able to detect it because you haven't linked your GitHub account to your LiveCode account. Please see the information for contributors for more information. |
Linked Livecode to my account |
Mark Waddingham commented on the forum that actually OnMouseUp should work wherever the mouse goes up |
@BerndN: Whilst there is a bug in the widget event flow (from what I can see), the mouseCancel handler you've added is still necessary... There's nothing to stop a script from causing UI context to change whilst a drag is occurring in the gradient ramp editor (a script could decide to popup a dialog box randomly, for example) so your change is still needed :) |
beginners luck :) |
@@ -285,6 +285,10 @@ public handler OnMouseDoubleUp() returns nothing | |||
gradientStopsChanged() | |||
end handler | |||
|
|||
public handler onMouseCancel() returns nothing | |||
put false into mIsDraggingStop |
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.
The mouseCancel handler should function in the same way as mouseUp, by making sure that we redraw and send the gradient stop changed message.
put xCoordToStopNumber(the x of the mouse position) into mCurrentlySelectedStopIndex
redraw all
gradientStopsChanged()
It might be worth refactoring the common code in mouseUp and mouseCancel into a new handler.
Hi @BerndN Thanks very much for the pull request. I've added an inline comment on a minor update. On more thing we require with bug fixes is an additional file called Could you also add this file to the pull request please? |
@livecodemichael |
Using this current pull request is fine. Any commits you make to your branch patch-1 will be reflected here. Your update to the onMouseCancel looks good. Thanks for that. All that remains is to add the bug fix note. Add a file docs/notes/bugfix-16032.md to you branch patch-1 with the content # catch OnMouseCancel in gradientrampeditor and it should appear in this pull request. Once that's done we can get it reviewed and integrated. Thanks very much. |
Sorry, I thought I had done it but only now saw "patch-1" for some reason and tried again. |
@BerndN Thank you! I'm glad you managed to work it out in the end. For next time, please bear in mind that in general we would like all commits to have clear & descriptive commit messages. A good way to think about a good commit message is that the first line should complete the sentence, "When merged, this commit will...". For example:
For more information, I recommend this article: How to write a commit message |
@livecode-vulcan review ok 725fc07 |
💙 review by @livecodemichael ok 725fc07 |
[[ Bug 16032 ]] gradientrampeditor widget does not catch mouse relea… …se outside card bounds gradientrampeditor does not catch mouseUp when it occurs outside of card bounds. Added OnMouseCancel handler.
[[ Bug 16032 ]] gradientrampeditor widget does not catch mouse relea…
…se outside card bounds
gradientrampeditor does not catch mouseUp when it occurs outside of card bounds. Added OnMouseCancel handler.