页面h5适配
This commit is contained in:
@@ -178,11 +178,11 @@ export default class Utils {
|
||||
//let windowSize = view.getVisibleSize();
|
||||
let bgTf = node.getComponent(UITransform);
|
||||
if (bgTf) {
|
||||
if (mod == 1 && bgTf.height <= windowSize.height) {
|
||||
if (mod == 1) {
|
||||
let scale = windowSize.height / bgTf.height;
|
||||
bgTf.height = bgTf.height * scale;
|
||||
bgTf.width = bgTf.width * scale;
|
||||
} else if (mod == 2 && bgTf.width <= windowSize.width) {
|
||||
} else if (mod == 2) {
|
||||
let scale = windowSize.width / bgTf.width;
|
||||
bgTf.height = bgTf.height * scale;
|
||||
bgTf.width = bgTf.width * scale;
|
||||
|
||||
Reference in New Issue
Block a user