mirror of
https://github.com/aster94/logic-analyzer.git
synced 2026-05-02 08:35:21 +03:00
Merge pull request #4 from yoursunny/scroll
processing: preserve scroll position while zooming
This commit is contained in:
@@ -312,8 +312,10 @@ void mouseWheel(MouseEvent event) {
|
|||||||
if (mouseY>buttonY && mouseY <buttonY+buttonH &&
|
if (mouseY>buttonY && mouseY <buttonY+buttonH &&
|
||||||
mouseX>button4X && mouseX <button4X+smallButtonW) {
|
mouseX>button4X && mouseX <button4X+smallButtonW) {
|
||||||
//it is over the reducer button
|
//it is over the reducer button
|
||||||
|
xShift *= reducer;
|
||||||
reducer-= wheel/10;
|
reducer-= wheel/10;
|
||||||
reducer = constrain(reducer, 0.1, 9.9);
|
reducer = constrain(reducer, 0.1, 9.9);
|
||||||
|
xShift /= reducer; // preserve scroll position
|
||||||
getData();
|
getData();
|
||||||
} else { //move the graph
|
} else { //move the graph
|
||||||
xShift-=wheel*50;
|
xShift-=wheel*50;
|
||||||
|
|||||||
Reference in New Issue
Block a user