aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm
diff options
context:
space:
mode:
authorgeireann <60007097+geireann@users.noreply.github.com>2020-06-17 19:13:19 +0800
committergeireann <60007097+geireann@users.noreply.github.com>2020-06-17 19:13:19 +0800
commit79d9ccbe68d0e567eba1daae0500d9ddba177b1b (patch)
tree2782768aabf6b9b33c27294779aeb66bd0e1b0d8 /src/client/views/collections/collectionFreeForm
parent3ccc8e92682bfa257ef2052513b1826b811f6881 (diff)
parentc2349c0b00ae15e2aa715e0b535a88d5a3d89f5e (diff)
Merge branch 'master' into mobile_revision_direct
Diffstat (limited to 'src/client/views/collections/collectionFreeForm')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx3
-rw-r--r--src/client/views/collections/collectionFreeForm/InkOptionsMenu.tsx22
2 files changed, 12 insertions, 13 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index cddac01ad..82d6dee73 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -457,7 +457,8 @@ export class CollectionFreeFormView extends CollectionSubView<PanZoomDocument, P
case GestureUtils.Gestures.Stroke:
const points = ge.points;
const B = this.getTransform().transformBounds(ge.bounds.left, ge.bounds.top, ge.bounds.width, ge.bounds.height);
- const inkDoc = Docs.Create.InkDocument(ActiveInkColor(), Doc.GetSelectedTool(), ActiveInkWidth(), ActiveInkBezierApprox(), points, { title: "ink stroke", x: B.x, y: B.y, _width: B.width, _height: B.height });
+ const inkDoc = Docs.Create.InkDocument(ActiveInkColor(), Doc.GetSelectedTool(), ActiveInkWidth(), ActiveInkBezierApprox(), points,
+ { title: "ink stroke", x: B.x - Number(ActiveInkWidth()) / 2, y: B.y - Number(ActiveInkWidth()) / 2, _width: B.width + Number(ActiveInkWidth()), _height: B.height + Number(ActiveInkWidth()) });
this.addDocument(inkDoc);
e.stopPropagation();
break;
diff --git a/src/client/views/collections/collectionFreeForm/InkOptionsMenu.tsx b/src/client/views/collections/collectionFreeForm/InkOptionsMenu.tsx
index e7ef4cbd2..647847b68 100644
--- a/src/client/views/collections/collectionFreeForm/InkOptionsMenu.tsx
+++ b/src/client/views/collections/collectionFreeForm/InkOptionsMenu.tsx
@@ -99,16 +99,14 @@ export default class InkOptionsMenu extends AntimodeMenu {
}
@computed get shapeButtons() {
- return <>
- {this._buttons.map((btn, i) => <button
- className="antimodeMenu-button"
- title={`Draw ${btn}`}
- key={btn}
- onPointerDown={action(e => GestureOverlay.Instance.InkShape = btn)}
- style={{ backgroundColor: btn === GestureOverlay.Instance?.InkShape ? "121212" : "" }}>
- {this._icons[i]}
- </button>)}
- </>;
+ return this._buttons.map((btn, i) => <button
+ className="antimodeMenu-button"
+ title={`Draw ${btn}`}
+ key={i}
+ onPointerDown={action(e => GestureOverlay.Instance.InkShape = btn)}
+ style={{ backgroundColor: btn === GestureOverlay.Instance.InkShape ? "121212" : "" }}>
+ {this._icons[i]}
+ </button>);
}
@computed get bezierButton() {
@@ -125,7 +123,7 @@ export default class InkOptionsMenu extends AntimodeMenu {
render() {
const buttons = [
<button className="antimodeMenu-button" title="Drag" key="drag" onPointerDown={e => this.dragStart(e)}> ✜ </button>,
- this.shapeButtons,
+ ...this.shapeButtons,
this.bezierButton,
this.widthPicker,
this.colorPicker,
@@ -149,4 +147,4 @@ Scripting.addGlobal(function activatePen(penBtn: any) {
Doc.SetSelectedTool(InkTool.None);
InkOptionsMenu.Instance.fadeOut(true);
}
-}); \ No newline at end of file
+});