kopia lustrzana https://github.com/backface/turtlestitch
added scroll up and down events to receiveInteraction hat block
rodzic
7e74a345e5
commit
18750cc0d9
|
@ -993,7 +993,9 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
|
|||
'pressed' : ['pressed'],
|
||||
'dropped' : ['dropped'],
|
||||
'mouse-entered' : ['mouse-entered'],
|
||||
'mouse-departed' : ['mouse-departed']
|
||||
'mouse-departed' : ['mouse-departed'],
|
||||
'scrolled-up' : ['scrolled-up'],
|
||||
'scrolled-down' : ['scrolled-down']
|
||||
},
|
||||
true // read-only
|
||||
);
|
||||
|
|
|
@ -4827,6 +4827,10 @@ SpriteMorph.prototype.mouseDownLeft = function () {
|
|||
return this.receiveUserInteraction('pressed');
|
||||
};
|
||||
|
||||
SpriteMorph.prototype.mouseScroll = function (y) {
|
||||
return this.receiveUserInteraction('scrolled-' + (y > 0 ? 'up' : 'down'));
|
||||
};
|
||||
|
||||
SpriteMorph.prototype.receiveUserInteraction = function (interaction) {
|
||||
var stage = this.parentThatIsA(StageMorph),
|
||||
procs = [],
|
||||
|
|
Ładowanie…
Reference in New Issue