diff options
author | bobzel <zzzman@gmail.com> | 2021-01-11 11:33:46 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-01-11 11:33:46 -0500 |
commit | 6c1857193aa51ccfec081aaa4372de164e152355 (patch) | |
tree | 8ae584d0c0a262df63153fec097f32ab9ef80441 /src/client/views/nodes/ColorBox.tsx | |
parent | 768ab508529ab2b7f43a44592e5dc2c9f15a68a5 (diff) | |
parent | e80e0e3938f1f7c5f740553eb5cb7b152f2598e8 (diff) |
Merge branch 'master' into ink_edits
Diffstat (limited to 'src/client/views/nodes/ColorBox.tsx')
-rw-r--r-- | src/client/views/nodes/ColorBox.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/views/nodes/ColorBox.tsx b/src/client/views/nodes/ColorBox.tsx index 4fb350b55..d5b6a269e 100644 --- a/src/client/views/nodes/ColorBox.tsx +++ b/src/client/views/nodes/ColorBox.tsx @@ -31,7 +31,7 @@ export class ColorBox extends ViewBoxBaseComponent<FieldViewProps, ColorDocument SetActiveInkColor(color.hex); if (Doc.GetSelectedTool() === InkTool.None) { - const selected = SelectionManager.SelectedDocuments(); + const selected = SelectionManager.Views(); selected.map(view => { const targetDoc = view.props.Document.dragFactory instanceof Doc ? view.props.Document.dragFactory : view.props.Document.layout instanceof Doc ? view.props.Document.layout : @@ -54,10 +54,10 @@ export class ColorBox extends ViewBoxBaseComponent<FieldViewProps, ColorDocument super(props); } render() { - const selDoc = SelectionManager.SelectedDocuments()?.[0]?.rootDoc; + const selDoc = SelectionManager.Views()?.[0]?.rootDoc; return <div className={`colorBox-container${this.active() ? "-interactive" : ""}`} onPointerDown={e => e.button === 0 && !e.ctrlKey && e.stopPropagation()} onClick={e => { (e.nativeEvent as any).stuff = true; e.stopPropagation(); }} - style={{ transform: `scale(${this.props.ContentScaling()})`, width: `${100 / this.props.ContentScaling()}%`, height: `${100 / this.props.ContentScaling()}%` }} > + style={{ width: `${100}%`, height: `${100}%` }} > <SketchPicker onChange={ColorBox.switchColor} presetColors={['#D0021B', '#F5A623', '#F8E71C', '#8B572A', '#7ED321', '#417505', '#9013FE', '#4A90E2', '#50E3C2', '#B8E986', '#000000', '#4A4A4A', '#9B9B9B', '#FFFFFF', '#f1efeb', 'transparent']} color={StrCast(ActiveInkPen()?.backgroundColor, @@ -67,7 +67,7 @@ export class ColorBox extends ViewBoxBaseComponent<FieldViewProps, ColorDocument <div> {ActiveInkWidth() ?? 2}</div> <input type="range" defaultValue={ActiveInkWidth() ?? 2} min={1} max={100} onChange={(e: React.ChangeEvent<HTMLInputElement>) => { SetActiveInkWidth(e.target.value); - SelectionManager.SelectedDocuments().filter(i => StrCast(i.rootDoc.type) === DocumentType.INK).map(i => i.rootDoc.strokeWidth = Number(e.target.value)); + SelectionManager.Views().filter(i => StrCast(i.rootDoc.type) === DocumentType.INK).map(i => i.rootDoc.strokeWidth = Number(e.target.value)); }} /> {/* <div> {ActiveInkBezierApprox() ?? 2}</div> <input type="range" defaultValue={ActiveInkBezierApprox() ?? 2} min={0} max={300} onChange={(e: React.ChangeEvent<HTMLInputElement>) => { |