File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
extensions/ccui/base-classes Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ var simpleQuadGenerator = {
136136 var atlasWidth = spriteFrame . _texture . _pixelsWide ;
137137 var atlasHeight = spriteFrame . _texture . _pixelsHigh ;
138138 var textureRect = spriteFrame . _rect ;
139+ textureRect = cc . rectPointsToPixels ( textureRect ) ;
139140
140141 if ( uvs . length < 8 ) {
141142 dataPool . put ( uvs ) ;
@@ -254,12 +255,15 @@ var scale9QuadGenerator = {
254255 var leftWidth , centerWidth , rightWidth ;
255256 var topHeight , centerHeight , bottomHeight ;
256257 var textureRect = spriteFrame . _rect ;
258+ textureRect = cc . rectPointsToPixels ( textureRect ) ;
259+ rect = cc . rectPointsToPixels ( rect ) ;
260+ var scale = cc . contentScaleFactor ( ) ;
257261
258- leftWidth = insetLeft ;
259- rightWidth = insetRight ;
262+ leftWidth = insetLeft * scale ;
263+ rightWidth = insetRight * scale ;
260264 centerWidth = rect . width - leftWidth - rightWidth ;
261- topHeight = insetTop ;
262- bottomHeight = insetBottom ;
265+ topHeight = insetTop * scale ;
266+ bottomHeight = insetBottom * scale ;
263267 centerHeight = rect . height - topHeight - bottomHeight ;
264268
265269 if ( uvs . length < 32 ) {
You can’t perform that action at this time.
0 commit comments