validate props
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Владимир Фёдоров 2023-07-02 22:40:45 +07:00
parent 342246d77b
commit 5cb1a48466
1 changed files with 7 additions and 0 deletions

View File

@ -28,6 +28,13 @@ const clearCanvas = () => {
const render = () => { const render = () => {
const { vMargin, vRotation, hMargin, hMargin2, imageWidth, imageHeight } = props; const { vMargin, vRotation, hMargin, hMargin2, imageWidth, imageHeight } = props;
if (vMargin < 1 || hMargin < 1 || hMargin2 < 1) {
return
}
if (imageWidth < 1 || imageHeight < 1) {
return
}
clearCanvas(); clearCanvas();
var hMargins = [hMargin, hMargin2]; var hMargins = [hMargin, hMargin2];