|
@@ -10,7 +10,7 @@ import Vec from '@tldraw/vec'
|
|
|
import { action, computed, makeObservable, observable, toJS, transaction } from 'mobx'
|
|
|
import { BINDING_DISTANCE } from '../../../constants'
|
|
|
import type { TLHandle, TLResizeEdge, TLResizeCorner, TLAsset } from '../../../types'
|
|
|
-import { BoundsUtils, PointUtils, deepCopy } from '../../../utils'
|
|
|
+import { BoundsUtils, PointUtils, deepCopy, getComputedColor } from '../../../utils'
|
|
|
|
|
|
export type TLShapeModel<P extends TLShapeProps = TLShapeProps> = {
|
|
|
nonce?: number
|
|
@@ -370,8 +370,8 @@ export abstract class TLShape<P extends TLShapeProps = TLShapeProps, M = any> {
|
|
|
.props as any
|
|
|
return (
|
|
|
<rect
|
|
|
- fill={noFill ? 'none' : fill}
|
|
|
- stroke={noFill ? fill : stroke}
|
|
|
+ fill={noFill ? 'none' : getComputedColor(fill, 'background')}
|
|
|
+ stroke={getComputedColor(stroke, 'stroke')}
|
|
|
strokeWidth={strokeWidth ?? 2}
|
|
|
strokeDasharray={strokeType === 'dashed' ? '8 2' : undefined}
|
|
|
fillOpacity={opacity ?? 0.2}
|