提交 1123731e 编写于 作者: Q qiang

Merge branch 'dev' into alpha

......@@ -51,6 +51,7 @@
|locationEnabled | 地理位置的系统开关 |微信小程序|
|wifiEnabled | Wi-Fi 的系统开关 |微信小程序|
|safeArea|在竖屏正方向下的安全区域|5+App、H5、微信小程序|
|safeAreaInsets|在竖屏正方向下的安全区域插入位置(2.5.3+)|5+App、H5、微信小程序|
**Tips**
- 屏幕高度=状态栏高度+原生导航栏高度+可使用窗口高度+原生tabbar高度
......@@ -68,6 +69,15 @@
|width |Number |安全区域的宽度,单位逻辑像素 |
|height |Number |安全区域的高度,单位逻辑像素 |
**safeAreaInsets 的结构**
|参数 |类型 |说明 |
|:- |:- |:- |
|left |Number |安全区域左侧插入位置 |
|right |Number |安全区域右侧插入位置 |
|top |Number |安全区顶部插入位置 |
|bottom |Number |安全区域底部插入位置 |
**示例**
......@@ -130,6 +140,7 @@ uni.getSystemInfo({
|locationEnabled | 地理位置的系统开关 |微信小程序|
|wifiEnabled | Wi-Fi 的系统开关 |微信小程序|
|safeArea|在竖屏正方向下的安全区域|5+App、H5、微信小程序|
|safeAreaInsets|在竖屏正方向下的安全区域插入位置(2.5.3+)|5+App、H5、微信小程序|
**Tips**
- 使用注意同上getSystemInfo
......@@ -145,6 +156,14 @@ uni.getSystemInfo({
|width |Number |安全区域的宽度,单位逻辑像素 |
|height |Number |安全区域的高度,单位逻辑像素 |
**safeAreaInsets 的结构**
|参数 |类型 |说明 |
|:- |:- |:- |
|left |Number |安全区域左侧插入位置 |
|right |Number |安全区域右侧插入位置 |
|top |Number |安全区顶部插入位置 |
|bottom |Number |安全区域底部插入位置 |
**示例**
......
......@@ -38,6 +38,24 @@ const ratioArgs = {
}
const proto = CanvasRenderingContext2D.prototype
proto.drawImageByCanvas = (function (_super) {
return function (canvas, srcx, srcy, srcw, srch, desx, desy, desw, desh, isScale) {
if (!this.__hidpi__) {
return _super.apply(this, arguments)
}
srcx *= pixelRatio
srcy *= pixelRatio
srcw *= pixelRatio
srch *= pixelRatio
desx *= pixelRatio
desy *= pixelRatio
desw = isScale ? desw * pixelRatio : desw
desh = isScale ? desh * pixelRatio : desh
_super.call(this, canvas, srcx, srcy, srcw, srch, desx, desy, desw, desh)
}
})(proto.drawImage)
if (pixelRatio !== 1) {
forEach(ratioArgs, function (value, key) {
proto[key] = (function (_super) {
......@@ -141,23 +159,6 @@ if (pixelRatio !== 1) {
})(proto.drawImage)
}
proto.drawImageByCanvas = (function (_super) {
return function (canvas, srcx, srcy, srcw, srch, desx, desy, desw, desh, isScale) {
if (!this.__hidpi__) {
return _super.apply(this, arguments)
}
srcx *= pixelRatio
srcy *= pixelRatio
srcw *= pixelRatio
srch *= pixelRatio
desx *= pixelRatio
desy *= pixelRatio
desw = isScale ? desw * pixelRatio : desw
desh = isScale ? desh * pixelRatio : desh
_super.call(this, canvas, srcx, srcy, srcw, srch, desx, desy, desw, desh)
}
})(proto.drawImage)
export function wrapper (canvas) {
canvas.width = canvas.offsetWidth * pixelRatio
canvas.height = canvas.offsetHeight * pixelRatio
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册