diff --git a/packages/tldraw/src/lib/shapes/geo/GeoShapeUtil.tsx b/packages/tldraw/src/lib/shapes/geo/GeoShapeUtil.tsx index 7ad86aa41..7ea6b9198 100644 --- a/packages/tldraw/src/lib/shapes/geo/GeoShapeUtil.tsx +++ b/packages/tldraw/src/lib/shapes/geo/GeoShapeUtil.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react-hooks/rules-of-hooks */ import { BaseBoxShapeUtil, DefaultFontFamilies, @@ -41,7 +40,6 @@ import { } from '../shared/defaultStyleDefs' import { getTextLabelSvgElement } from '../shared/getTextLabelSvgElement' import { getRoundedInkyPolygonPath, getRoundedPolygonPoints } from '../shared/polygon-helpers' -import { useForceSolid } from '../shared/useForceSolid' import { cloudOutline, cloudSvgPath } from './cloudOutline' import { DashStyleCloud, DashStyleCloudSvg } from './components/DashStyleCloud' import { DashStyleEllipse, DashStyleEllipseSvg } from './components/DashStyleEllipse' @@ -369,7 +367,6 @@ export class GeoShapeUtil extends BaseBoxShapeUtil { component(shape: TLGeoShape) { const { id, type, props } = shape - const forceSolid = useForceSolid() const strokeWidth = STROKE_SIZES[props.size] const { w, color, labelColor, fill, dash, growY, font, align, verticalAlign, size, text } = @@ -380,7 +377,7 @@ export class GeoShapeUtil extends BaseBoxShapeUtil { switch (props.geo) { case 'cloud': { - if (dash === 'solid' || (dash === 'draw' && forceSolid)) { + if (dash === 'solid') { return ( { h={h} id={id} size={size} - dash={dash === 'dashed' ? dash : size === 's' && forceSolid ? 'dashed' : dash} + dash={dash} /> ) } else if (dash === 'draw') { @@ -422,7 +419,7 @@ export class GeoShapeUtil extends BaseBoxShapeUtil { break } case 'ellipse': { - if (dash === 'solid' || (dash === 'draw' && forceSolid)) { + if (dash === 'solid') { return ( ) @@ -433,7 +430,7 @@ export class GeoShapeUtil extends BaseBoxShapeUtil { strokeWidth={strokeWidth} w={w} h={h} - dash={dash === 'dashed' ? dash : size === 's' && forceSolid ? 'dashed' : dash} + dash={dash} color={color} fill={fill} /> @@ -446,7 +443,7 @@ export class GeoShapeUtil extends BaseBoxShapeUtil { break } case 'oval': { - if (dash === 'solid' || (dash === 'draw' && forceSolid)) { + if (dash === 'solid') { return ( ) @@ -457,7 +454,7 @@ export class GeoShapeUtil extends BaseBoxShapeUtil { strokeWidth={strokeWidth} w={w} h={h} - dash={dash === 'dashed' ? dash : size === 's' && forceSolid ? 'dashed' : dash} + dash={dash} color={color} fill={fill} /> @@ -475,7 +472,7 @@ export class GeoShapeUtil extends BaseBoxShapeUtil { geometry instanceof Group2d ? geometry.children[0].vertices : geometry.vertices const lines = getLines(shape.props, strokeWidth) - if (dash === 'solid' || (dash === 'draw' && forceSolid)) { + if (dash === 'solid') { return ( { } else if (dash === 'dashed' || dash === 'dotted') { return ( { const { w, size } = props const h = props.h + props.growY - const forceSolid = useForceSolid() const strokeWidth = STROKE_SIZES[size] switch (props.geo) { case 'ellipse': { - if (props.dash === 'draw' && !forceSolid) { + if (props.dash === 'draw') { return } @@ -563,7 +559,7 @@ export class GeoShapeUtil extends BaseBoxShapeUtil { geometry instanceof Group2d ? geometry.children[0].vertices : geometry.vertices let path: string - if (props.dash === 'draw' && !forceSolid) { + if (props.dash === 'draw') { const polygonPoints = getRoundedPolygonPoints(id, outline, 0, strokeWidth * 2, 1) path = getRoundedInkyPolygonPath(polygonPoints) } else { diff --git a/packages/tldraw/src/lib/shapes/line/LineShapeUtil.tsx b/packages/tldraw/src/lib/shapes/line/LineShapeUtil.tsx index 9dfac0df4..596a60b2b 100644 --- a/packages/tldraw/src/lib/shapes/line/LineShapeUtil.tsx +++ b/packages/tldraw/src/lib/shapes/line/LineShapeUtil.tsx @@ -22,7 +22,6 @@ import { ShapeFill, useDefaultColorTheme } from '../shared/ShapeFill' import { STROKE_SIZES } from '../shared/default-shape-constants' import { getPerfectDashProps } from '../shared/getPerfectDashProps' import { getDrawLinePathData } from '../shared/polygon-helpers' -import { useForceSolid } from '../shared/useForceSolid' import { getLineDrawPath, getLineIndicatorPath } from './components/getLinePath' import { getLineSvg } from './components/getLineSvg' import { @@ -171,7 +170,6 @@ export class LineShapeUtil extends ShapeUtil { component(shape: TLLineShape) { const theme = useDefaultColorTheme() - const forceSolid = useForceSolid() const spline = getGeometryForLineShape(shape) const strokeWidth = STROKE_SIZES[shape.props.size] @@ -249,7 +247,7 @@ export class LineShapeUtil extends ShapeUtil { if (shape.props.spline === 'cubic') { const splinePath = getSvgPathForLineGeometry(spline) - if (dash === 'solid' || (dash === 'draw' && forceSolid)) { + if (dash === 'solid') { return (