@@ -289,8 +289,6 @@ + (nullable NSData *)screenMaskPNGDataForDeviceName:(NSString *)deviceName
289289 BOOL hasModernPhoneSensor = [self shouldRenderPhoneChromeFromSlices: plist sensorName: sensorName];
290290 BOOL hasComposite = !hasModernPhoneSensor && [self compositeAssetPathForChromeInfo: chromeInfo].length > 0 ;
291291 CGFloat screenScale = MAX ([self numberValue: plist[@" mainScreenScale" ]], 1.0 );
292- CGFloat profileScreenWidth = [self numberValue: plist[@" mainScreenWidth" ]];
293- CGFloat profileScreenHeight = [self numberValue: plist[@" mainScreenHeight" ]];
294292 CGSize profileScreenSize = [self screenSizeForChromeInfo: chromeInfo
295293 chromeSize: compositeSize
296294 screenScale: screenScale];
@@ -301,17 +299,17 @@ + (nullable NSData *)screenMaskPNGDataForDeviceName:(NSString *)deviceName
301299 CGFloat screenHeight;
302300 CGFloat screenX;
303301 CGFloat screenY;
304- if (hasComposite && pointScreenWidth > 0.0 && pointScreenHeight > 0.0 ) {
302+ if (watchProfile) {
303+ screenX = sizingLeft;
304+ screenY = sizingTop;
305+ screenWidth = MAX (compositeSize.width - sizingLeft - sizingRight, 1.0 );
306+ screenHeight = MAX (compositeSize.height - standHeight - sizingTop - sizingBottom, 1.0 );
307+ } else if (hasComposite && pointScreenWidth > 0.0 && pointScreenHeight > 0.0 ) {
305308 screenWidth = pointScreenWidth;
306309 screenHeight = pointScreenHeight;
307310 screenX = MAX ((compositeSize.width - screenWidth) / 2.0 , 0.0 );
308311 CGFloat usableHeight = compositeSize.height - standHeight;
309312 screenY = MAX ((usableHeight - screenHeight) / 2.0 , bezelTop);
310- } else if (watchProfile) {
311- screenWidth = profileScreenWidth;
312- screenHeight = profileScreenHeight;
313- screenX = MAX ((compositeSize.width - screenWidth) / 2.0 , 0.0 );
314- screenY = MAX ((compositeSize.height - screenHeight) / 2.0 , 0.0 );
315313 } else {
316314 screenX = bezelLeft;
317315 screenY = bezelTop;
@@ -320,7 +318,7 @@ + (nullable NSData *)screenMaskPNGDataForDeviceName:(NSString *)deviceName
320318 }
321319
322320 CGFloat innerRadius = MAX (rawCornerRadius - MAX (screenX, screenY), 0.0 );
323- CGFloat radiusScale = pointScreenWidth > 0.0 ? screenWidth / pointScreenWidth : 1.0 ;
321+ CGFloat radiusScale = !watchProfile && pointScreenWidth > 0.0 ? screenWidth / pointScreenWidth : 1.0 ;
324322 CGFloat chromeCornerRadius = innerRadius * radiusScale;
325323 CGFloat cornerRadius = chromeCornerRadius;
326324
0 commit comments