mirror of
https://github.com/aster94/logic-analyzer.git
synced 2026-05-01 23:53:02 +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 &&
|
||||
mouseX>button4X && mouseX <button4X+smallButtonW) {
|
||||
//it is over the reducer button
|
||||
xShift *= reducer;
|
||||
reducer-= wheel/10;
|
||||
reducer = constrain(reducer, 0.1, 9.9);
|
||||
xShift /= reducer; // preserve scroll position
|
||||
getData();
|
||||
} else { //move the graph
|
||||
xShift-=wheel*50;
|
||||
|
||||
Reference in New Issue
Block a user