mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-03 17:42:41 +08:00
Fix divide 0 issue in Scale9Sprite
This commit is contained in:
@@ -214,8 +214,8 @@ var scale9QuadGenerator = {
|
||||
var sizableHeight = preferSize.height - topHeight - bottomHeight;
|
||||
var xScale = preferSize.width / (leftWidth + rightWidth);
|
||||
var yScale = preferSize.height / (topHeight + bottomHeight);
|
||||
xScale = xScale > 1 ? 1 : xScale;
|
||||
yScale = yScale > 1 ? 1 : yScale;
|
||||
xScale = isNaN(xScale) || xScale > 1 ? 1 : xScale;
|
||||
yScale = isNaN(yScale) || yScale > 1 ? 1 : yScale;
|
||||
sizableWidth = sizableWidth < 0 ? 0 : sizableWidth;
|
||||
sizableHeight = sizableHeight < 0 ? 0 : sizableHeight;
|
||||
var x = this.x;
|
||||
|
||||
Reference in New Issue
Block a user