Commit 10733565 authored by 范雪寒's avatar 范雪寒

feat: 缩放

parent 3df3f038
...@@ -1714,9 +1714,9 @@ export class ScrollView extends MySprite { ...@@ -1714,9 +1714,9 @@ export class ScrollView extends MySprite {
const viewRect = this.getBoundingBox(); const viewRect = this.getBoundingBox();
if (this.scrollSide == ScrollSideType.VERTICAL) { if (this.scrollSide == ScrollSideType.VERTICAL) {
// sprite.setScaleXY(viewRect.width / sprite.width); sprite.setScaleXY(viewRect.width / sprite.width);
} else { } else {
// sprite.setScaleXY(viewRect.height / sprite.height); sprite.setScaleXY(viewRect.height / sprite.height);
} }
if (this.scrollSide == ScrollSideType.VERTICAL) { if (this.scrollSide == ScrollSideType.VERTICAL) {
...@@ -1771,7 +1771,6 @@ export class ScrollView extends MySprite { ...@@ -1771,7 +1771,6 @@ export class ScrollView extends MySprite {
this.content.y = between(this.touchStartContentPos.y + offsetY, 0, this.getBoundingBox().height - this.content.height); this.content.y = between(this.touchStartContentPos.y + offsetY, 0, this.getBoundingBox().height - this.content.height);
} else { } else {
this.content.x = between(this.touchStartContentPos.x + offsetX, 0, this.getBoundingBox().width - this.content.width); this.content.x = between(this.touchStartContentPos.x + offsetX, 0, this.getBoundingBox().width - this.content.width);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment