diff --git a/pages/CSS/overflow/overflow-visible-event.uvue b/pages/CSS/overflow/overflow-visible-event.uvue index d9854339cc23ebf328a1cd30f1427b9661b3dff5..52f8aba753c08d9c4a3ffb1f6b985ef269c28cd6 100644 --- a/pages/CSS/overflow/overflow-visible-event.uvue +++ b/pages/CSS/overflow/overflow-visible-event.uvue @@ -99,14 +99,12 @@ }, async jest_getRect() { const rect = await uni.getElementById('child')!.getBoundingClientRectAsync() - if (rect != null) { - let ratio = 1 - if (uni.getSystemInfoSync().platform == 'android'){ - ratio = uni.getSystemInfoSync().devicePixelRatio - } - this.jest_click_x = rect.x * ratio + 30 - this.jest_click_y = rect.bottom * ratio - 30 - } + let ratio = 1 + if (uni.getSystemInfoSync().platform == 'android'){ + ratio = uni.getSystemInfoSync().devicePixelRatio + } + this.jest_click_x = rect.x * ratio + 30 + this.jest_click_y = rect.bottom * ratio - 30 }, jest_getParentRect() { const transform = uni.getElementById('parent')?.style.getPropertyValue("transform") @@ -122,37 +120,31 @@ }, async jest_getAbsoluteViewRect() { const rect = await uni.getElementById('absolute-view')!.getBoundingClientRectAsync() - if (rect != null) { - const systemInfo = uni.getSystemInfoSync() - const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight - let ratio = 1 - if (uni.getSystemInfoSync().platform == 'android'){ - ratio = uni.getSystemInfoSync().devicePixelRatio - } - this.jest_click_x = rect.x * ratio + 30 - this.jest_click_y = (rect.top + titleBarHeight) * ratio + 30 + const systemInfo = uni.getSystemInfoSync() + const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight + let ratio = 1 + if (uni.getSystemInfoSync().platform == 'android'){ + ratio = uni.getSystemInfoSync().devicePixelRatio } + this.jest_click_x = rect.x * ratio + 30 + this.jest_click_y = (rect.top + titleBarHeight) * ratio + 30 }, async jest_scrollToDeepOverflow() { const scrollView = uni.getElementById('scroll-view') as UniScrollViewElement const rect = await uni.getElementById('deep-overflow')!.getBoundingClientRectAsync() - if (rect != null) { - scrollView.scrollTo(0, rect.top) - setTimeout(() => { - const systemInfo = uni.getSystemInfoSync() - let ratio = 1 - if (uni.getSystemInfoSync().platform == 'android'){ - ratio = uni.getSystemInfoSync().devicePixelRatio - } - const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight - uni.getElementById('deep-overflow')!.getBoundingClientRectAsync().then((afterRect: DOMRect) => { - if (afterRect != null) { - this.jest_click_x = afterRect.x * ratio + 30 - this.jest_click_y = (afterRect.top + titleBarHeight) * ratio + 30 - } - }) - }, 200) - } + scrollView.scrollTo(0, rect.top) + setTimeout(() => { + const systemInfo = uni.getSystemInfoSync() + let ratio = 1 + if (uni.getSystemInfoSync().platform == 'android'){ + ratio = uni.getSystemInfoSync().devicePixelRatio + } + const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight + uni.getElementById('deep-overflow')!.getBoundingClientRectAsync().then((afterRect: DOMRect) => { + this.jest_click_x = afterRect.x * ratio + 30 + this.jest_click_y = (afterRect.top + titleBarHeight) * ratio + 30 + }) + }, 200) } } } diff --git a/pages/component/canvas/canvas-context.uvue b/pages/component/canvas/canvas-context.uvue index 249b8bd520f44bf5049ac027d96e697c12555e97..0103183a251a4c3844c7f175d52c84ca0141bde6 100644 --- a/pages/component/canvas/canvas-context.uvue +++ b/pages/component/canvas/canvas-context.uvue @@ -799,12 +799,12 @@ const x4 = x1 + wavelength; const y4 = y1; context.moveTo(x1, y1); - path2D!.bezierCurveTo(x2, y2, x3, y3, x4, y4); + path2D.bezierCurveTo(x2, y2, x3, y3, x4, y4); } context.stroke(path2D); const path2DRect = this.canvasContext!.createPath2D(); - path2DRect!.rect(10, 10, 100, 20); + path2DRect.rect(10, 10, 100, 20); context.fill(path2DRect); }, fontTTF() {