mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-31 15:09:26 +08:00
修复layout的bug
This commit is contained in:
parent
d47c18105d
commit
9639f8670e
@ -64,7 +64,13 @@ export class Layout {
|
|||||||
if (img instanceof Path2D) {
|
if (img instanceof Path2D) {
|
||||||
this.ctx.fill(img);
|
this.ctx.fill(img);
|
||||||
} else {
|
} else {
|
||||||
this.ctx.drawImage(img, sx, sy, sw!, sh!, dx!, dy!, dw!, dh!);
|
if (!has(sw)) {
|
||||||
|
this.ctx.drawImage(img, sx, sy);
|
||||||
|
} else if (!has(dx)) {
|
||||||
|
this.ctx.drawImage(img, sx, sy, sw, sh!);
|
||||||
|
} else {
|
||||||
|
this.ctx.drawImage(img, sx, sy, sw, sh!, dx, dy!, dw!, dh!);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (type & Layout.IMAGE) {
|
if (type & Layout.IMAGE) {
|
||||||
|
Loading…
Reference in New Issue
Block a user