diff options
| author | bobzel <zzzman@gmail.com> | 2020-08-05 13:01:52 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2020-08-05 13:01:52 -0400 |
| commit | ffa36a87eb1093883dcc80128b08d24d2440f75a (patch) | |
| tree | 514141930818712091b4016b140490beb4d261ef /src/client/views/InkingStroke.tsx | |
| parent | aebfc10f1cb26e8db850611170db88dbbd88136f (diff) | |
fixed perfectly horizontal/vertical lines to display. make InkFields script editable.
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 fe5bf1eb2..6c5eda256 100644 --- a/src/client/views/InkingStroke.tsx +++ b/src/client/views/InkingStroke.tsx @@ -99,10 +99,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, |
