From 5cb1a484665bd333d5a3a705cadbdec35932e6d8 Mon Sep 17 00:00:00 2001 From: Fedorov Vladimir Date: Sun, 2 Jul 2023 22:40:45 +0700 Subject: [PATCH] validate props --- src/components/Canvas.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/Canvas.vue b/src/components/Canvas.vue index b3fe161..26492e8 100644 --- a/src/components/Canvas.vue +++ b/src/components/Canvas.vue @@ -28,6 +28,13 @@ const clearCanvas = () => { const render = () => { const { vMargin, vRotation, hMargin, hMargin2, imageWidth, imageHeight } = props; + if (vMargin < 1 || hMargin < 1 || hMargin2 < 1) { + return + } + if (imageWidth < 1 || imageHeight < 1) { + return + } + clearCanvas(); var hMargins = [hMargin, hMargin2];