removed mousewheel event handler for updating the graph
This commit is contained in:
@@ -34,31 +34,6 @@ export class AppComponent implements OnInit {
|
|||||||
public configForm: FormGroup;
|
public configForm: FormGroup;
|
||||||
public scaleOnWheel: boolean;
|
public scaleOnWheel: boolean;
|
||||||
|
|
||||||
@HostListener('mousewheel', ['$event'])
|
|
||||||
private onMousewheel(event) {
|
|
||||||
this.config = {...this.configForm.value};
|
|
||||||
|
|
||||||
if (this.scaleOnWheel) {
|
|
||||||
const delta = Math.sign(event.deltaY);
|
|
||||||
const step = env.controls.wheelStep;
|
|
||||||
|
|
||||||
if (delta > 0) {
|
|
||||||
if (this.config.scale === 1 - step) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.config.scale += step;
|
|
||||||
} else {
|
|
||||||
if (this.config.scale === step) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.config.scale -= step;
|
|
||||||
}
|
|
||||||
this.config.scale = Math.round(this.config.scale / step) * step;
|
|
||||||
}
|
|
||||||
this.configForm.reset({...this.config});
|
|
||||||
this.updateGraphs();
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.config = env.formDefaults;
|
this.config = env.formDefaults;
|
||||||
this.configForm = ConfigForm;
|
this.configForm = ConfigForm;
|
||||||
|
|||||||
Reference in New Issue
Block a user