fix:限制最小可缩宽度
This commit is contained in:
parent
e4b6c11e12
commit
5c59e27272
@ -343,6 +343,9 @@ export default class Painter {
|
||||
view.rect.top = view.rect.top - pd[0];
|
||||
view.rect.right = view.rect.right + pd[1];
|
||||
view.rect.bottom = view.rect.bottom + pd[2];
|
||||
if (view.type === 'text') {
|
||||
view.rect.minWidth = view.css.fontSize.toPx() + pd[1] + pd[3];
|
||||
}
|
||||
|
||||
this.ctx.rotate(angle);
|
||||
if (!notClip && view.css && view.css.borderRadius && view.type !== 'rect') {
|
||||
|
||||
10
painter.js
10
painter.js
@ -462,6 +462,16 @@ Component({
|
||||
let css = {}
|
||||
if (this.isScale) {
|
||||
const newW = this.startW + offsetX > 1 ? this.startW + offsetX : 1
|
||||
if (this.touchedView.css && this.touchedView.css.minWidth) {
|
||||
if (newW < this.touchedView.css.minWidth.toPx()) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if (this.touchedView.rect && this.touchedView.rect.minWidth) {
|
||||
if (newW < this.touchedView.rect.minWidth) {
|
||||
return
|
||||
}
|
||||
}
|
||||
const newH = this.startH + offsetY > 1 ? this.startH + offsetY : 1
|
||||
css = {
|
||||
width: `${newW}px`,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user