提交 554a2665 编写于 作者: D DCloud_LXH

chore: canvas

上级 de8faa07
...@@ -34,11 +34,14 @@ import { saveImage, getSameOriginUrl, getRealPath } from "@dcloudio/uni-platform ...@@ -34,11 +34,14 @@ import { saveImage, getSameOriginUrl, getRealPath } from "@dcloudio/uni-platform
import ResizeSensor from "../resize-sensor"; import ResizeSensor from "../resize-sensor";
import { useNativeEvent } from "../../helpers/useEvent"; import { useNativeEvent } from "../../helpers/useEvent";
import { pixelRatio, wrapper, initHidpi } from "../../helpers/hidpi"; import { pixelRatio, wrapper, initHidpi } from "../../helpers/hidpi";
import { once } from "@dcloudio/uni-shared";
!__NODE_JS__ && initHidpi(); const initHidpiOnce = /*#__PURE__*/ once(initHidpi)
function $getRealPath(src){ !__NODE_JS__ && initHidpiOnce();
return src ? getRealPath(src) : src
function $getRealPath(src) {
return src ? getRealPath(src) : src;
} }
function resolveColor(color) { function resolveColor(color) {
......
...@@ -594,7 +594,7 @@ var safeAreaInsets = { ...@@ -594,7 +594,7 @@ var safeAreaInsets = {
onChange, onChange,
offChange offChange
}; };
var out = safeAreaInsets; var D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out = safeAreaInsets;
const onEventPrevent = /* @__PURE__ */ withModifiers(() => { const onEventPrevent = /* @__PURE__ */ withModifiers(() => {
}, ["prevent"]); }, ["prevent"]);
const onEventStop = /* @__PURE__ */ withModifiers(() => { const onEventStop = /* @__PURE__ */ withModifiers(() => {
...@@ -606,10 +606,10 @@ function getWindowOffset() { ...@@ -606,10 +606,10 @@ function getWindowOffset() {
const left = parseInt(style.getPropertyValue("--window-left")); const left = parseInt(style.getPropertyValue("--window-left"));
const right = parseInt(style.getPropertyValue("--window-right")); const right = parseInt(style.getPropertyValue("--window-right"));
return { return {
top: top ? top + out.top : 0, top: top ? top + D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top : 0,
bottom: bottom ? bottom + out.bottom : 0, bottom: bottom ? bottom + D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.bottom : 0,
left: left ? left + out.left : 0, left: left ? left + D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.left : 0,
right: right ? right + out.right : 0 right: right ? right + D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.right : 0
}; };
} }
function updateCssVar(cssVars) { function updateCssVar(cssVars) {
...@@ -1291,7 +1291,7 @@ function normalizePageMeta(pageMeta) { ...@@ -1291,7 +1291,7 @@ function normalizePageMeta(pageMeta) {
let offset = rpx2px(refreshOptions.offset); let offset = rpx2px(refreshOptions.offset);
const {type} = navigationBar; const {type} = navigationBar;
if (type !== "transparent" && type !== "none") { if (type !== "transparent" && type !== "none") {
offset += NAVBAR_HEIGHT + out.top; offset += NAVBAR_HEIGHT + D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top;
} }
refreshOptions.offset = offset; refreshOptions.offset = offset;
refreshOptions.height = rpx2px(refreshOptions.height); refreshOptions.height = rpx2px(refreshOptions.height);
...@@ -2519,7 +2519,8 @@ function initHidpi() { ...@@ -2519,7 +2519,8 @@ function initHidpi() {
}(proto.drawImage); }(proto.drawImage);
} }
} }
initHidpi(); const initHidpiOnce = /* @__PURE__ */ once(initHidpi);
initHidpiOnce();
function $getRealPath(src) { function $getRealPath(src) {
return src ? getRealPath(src) : src; return src ? getRealPath(src) : src;
} }
...@@ -14881,7 +14882,7 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", () ...@@ -14881,7 +14882,7 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", ()
const windowWidth = getWindowWidth(screenWidth); const windowWidth = getWindowWidth(screenWidth);
let windowHeight = window.innerHeight; let windowHeight = window.innerHeight;
const language = navigator.language; const language = navigator.language;
const statusBarHeight = out.top; const statusBarHeight = D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top;
let osname; let osname;
let osversion; let osversion;
let model; let model;
...@@ -14994,12 +14995,12 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", () ...@@ -14994,12 +14995,12 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", ()
const system = `${osname} ${osversion}`; const system = `${osname} ${osversion}`;
const platform = osname.toLocaleLowerCase(); const platform = osname.toLocaleLowerCase();
const safeArea = { const safeArea = {
left: out.left, left: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.left,
right: windowWidth - out.right, right: windowWidth - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.right,
top: out.top, top: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top,
bottom: windowHeight - out.bottom, bottom: windowHeight - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.bottom,
width: windowWidth - out.left - out.right, width: windowWidth - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.left - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.right,
height: windowHeight - out.top - out.bottom height: windowHeight - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.bottom
}; };
const {top: windowTop, bottom: windowBottom} = getWindowOffset(); const {top: windowTop, bottom: windowBottom} = getWindowOffset();
windowHeight -= windowTop; windowHeight -= windowTop;
...@@ -15019,10 +15020,10 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", () ...@@ -15019,10 +15020,10 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", ()
model, model,
safeArea, safeArea,
safeAreaInsets: { safeAreaInsets: {
top: out.top, top: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top,
right: out.right, right: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.right,
bottom: out.bottom, bottom: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.bottom,
left: out.left left: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.left
} }
}; };
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册