Skip to content

Commit 678d24f

Browse files
JustinJustin
Justin
authored and
Justin
committed
cl
1 parent 439d670 commit 678d24f

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/Viewport.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ export class Viewport extends Container
194194
private _worldHeight?: number | null;
195195
private _disableOnContextMenu = (e: MouseEvent) => e.preventDefault();
196196

197+
public _wheelAxis?: 'all' | 'x' | 'y';
198+
197199
/**
198200
* @param {IViewportOptions} ViewportOptions
199201
* @param {number} [options.screenWidth=window.innerWidth]

src/plugins/ClampZoom.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export class ClampZoom extends Plugin
7878
if (this.options.minWidth !== null && width < this.options.minWidth)
7979
{
8080
const original = this.parent.scale.x;
81+
console.log('-- minwidth', this.parent._wheelAxis);
8182

8283
this.parent.fitWidth(this.options.minWidth, false, false, true);
8384
this.parent.scale.y *= this.parent.scale.x / original;
@@ -88,6 +89,7 @@ export class ClampZoom extends Plugin
8889
if (this.options.maxWidth !== null && width > this.options.maxWidth)
8990
{
9091
const original = this.parent.scale.x;
92+
console.log('-- maxwidth', this.parent._wheelAxis);
9193

9294
this.parent.fitWidth(this.options.maxWidth, false, false, true);
9395
this.parent.scale.y *= this.parent.scale.x / original;

src/plugins/Wheel.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export class Wheel extends Plugin
110110
{
111111
super(parent);
112112
this.options = Object.assign({}, DEFAULT_WHEEL_OPTIONS, options);
113+
this.parent._wheelAxis = this.options.axis;
113114
this.keyIsPressed = false;
114115

115116
if (this.options.keyToPress)

0 commit comments

Comments
 (0)