Skip to content

Commit

Permalink
fix: Fix invalid page size error caused by canvas size change
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerwin-L committed Jan 12, 2022
1 parent 643aed1 commit c958b71
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/lb-annotation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@labelbee/lb-annotation",
"version": "1.5.4-alpha.12",
"version": "1.5.4-alpha.13",
"description": "Annotation tool collection",
"keywords": [
"annotation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ class BasicToolOperation extends EventListener {
return;
}

this._invalidDOM = RenderDomUtils.renderInvalidPage(this.canvas, this.container, this.lang);
this._invalidDOM = RenderDomUtils.renderInvalidPage(this.container, this.size, this.lang);
}

public renderBasicCanvas() {
Expand Down
6 changes: 3 additions & 3 deletions packages/lb-annotation/src/utils/tool/RenderDomUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import locale from '../../locales';
import { EMessage } from '../../locales/constants';

export default class RenderDomUtils {
public static renderInvalidPage(canvas: HTMLCanvasElement, container: HTMLElement, lang: string) {
public static renderInvalidPage(container: HTMLElement, size: ISize, lang: string) {
const invalidDOM = document.createElement('div');
invalidDOM.setAttribute(
'style',
`
position: absolute;
left: 0px;
top: 0px;
width: ${canvas.width}px;
height: ${canvas.height}px;
width: ${size.width}px;
height: ${size.height}px;
background: rgba(255, 87, 34, 1);
overflow: hidden;
color: white;
Expand Down
2 changes: 1 addition & 1 deletion packages/lb-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"email": "brady_luo.sz@foxmail.com"
},
"dependencies": {
"@labelbee/lb-annotation": "1.5.4-alpha.12",
"@labelbee/lb-annotation": "1.5.4-alpha.13",
"@ant-design/icons": "^4.6.2",
"classnames": "^2.3.0",
"@labelbee/lb-utils": "^1.0.4-alpha.0",
Expand Down

0 comments on commit c958b71

Please sign in to comment.