diff options
| author | yunahi <60233430+yunahi@users.noreply.github.com> | 2020-08-10 22:49:50 +0900 |
|---|---|---|
| committer | yunahi <60233430+yunahi@users.noreply.github.com> | 2020-08-10 22:49:50 +0900 |
| commit | 01ebdb0db657f4c9de7959d2810548993a26e675 (patch) | |
| tree | 7f6146cf0818984546fd319bb375870ccd260bf9 /src/client/views/InkingStroke.tsx | |
| parent | d4ca38801b19e38b49b087be3e510cc0fca33eb8 (diff) | |
| parent | d3c49ce7b1921dec4c27f425b2af788e3d6385e9 (diff) | |
Merge branch 'ink_edits' of https://github.com/browngraphicslab/Dash-Web into ink_edits
:wq
Diffstat (limited to 'src/client/views/InkingStroke.tsx')
| -rw-r--r-- | src/client/views/InkingStroke.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/views/InkingStroke.tsx b/src/client/views/InkingStroke.tsx index 0afc71e9b..f0505ed95 100644 --- a/src/client/views/InkingStroke.tsx +++ b/src/client/views/InkingStroke.tsx @@ -107,10 +107,10 @@ export class InkingStroke extends ViewBoxBaseComponent<FieldViewProps, InkDocume const top = Math.min(...ys) - strokeWidth / 2; const right = Math.max(...xs) + strokeWidth / 2; const bottom = Math.max(...ys) + strokeWidth / 2; - const width = right - left; - const height = bottom - top; - const scaleX = (this.props.PanelWidth() - strokeWidth) / (width - strokeWidth); - const scaleY = (this.props.PanelHeight() - strokeWidth) / (height - strokeWidth); + const width = Math.max(right - left); + const height = Math.max(1, bottom - top); + const scaleX = width === strokeWidth ? 1 : (this.props.PanelWidth() - strokeWidth) / (width - strokeWidth); + const scaleY = height === strokeWidth ? 1 : (this.props.PanelHeight() - strokeWidth) / (height - strokeWidth); const strokeColor = StrCast(this.layoutDoc.color, ""); const points = InteractionUtils.CreatePolyline(data, left, top, strokeColor, strokeWidth, strokeWidth, |
