File tree 1 file changed +8
-4
lines changed
extensions/ccui/base-classes
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ var simpleQuadGenerator = {
136
136
var atlasWidth = spriteFrame . _texture . _pixelsWide ;
137
137
var atlasHeight = spriteFrame . _texture . _pixelsHigh ;
138
138
var textureRect = spriteFrame . _rect ;
139
+ textureRect = cc . rectPointsToPixels ( textureRect ) ;
139
140
140
141
if ( uvs . length < 8 ) {
141
142
dataPool . put ( uvs ) ;
@@ -254,12 +255,15 @@ var scale9QuadGenerator = {
254
255
var leftWidth , centerWidth , rightWidth ;
255
256
var topHeight , centerHeight , bottomHeight ;
256
257
var textureRect = spriteFrame . _rect ;
258
+ textureRect = cc . rectPointsToPixels ( textureRect ) ;
259
+ rect = cc . rectPointsToPixels ( rect ) ;
260
+ var scale = cc . contentScaleFactor ( ) ;
257
261
258
- leftWidth = insetLeft ;
259
- rightWidth = insetRight ;
262
+ leftWidth = insetLeft * scale ;
263
+ rightWidth = insetRight * scale ;
260
264
centerWidth = rect . width - leftWidth - rightWidth ;
261
- topHeight = insetTop ;
262
- bottomHeight = insetBottom ;
265
+ topHeight = insetTop * scale ;
266
+ bottomHeight = insetBottom * scale ;
263
267
centerHeight = rect . height - topHeight - bottomHeight ;
264
268
265
269
if ( uvs . length < 32 ) {
You can’t perform that action at this time.
0 commit comments