From b3aa4a5b0bbbb87d041b9515bddedbcbf8ae9fc5 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Fri, 8 Aug 2025 12:54:45 -0400
Subject: fixed sizing of arrows and dashes to relate to stroke width.  Made
 link's use fill to set color and default to backgorundColor

---
 src/client/views/StyleProvider.tsx | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

(limited to 'src/client/views/StyleProvider.tsx')

diff --git a/src/client/views/StyleProvider.tsx b/src/client/views/StyleProvider.tsx
index b52f17102..ca089a2fc 100644
--- a/src/client/views/StyleProvider.tsx
+++ b/src/client/views/StyleProvider.tsx
@@ -83,7 +83,6 @@ export function SetFilterOpener(func: () => void) {
 export function DefaultStyleProvider(doc: Opt<Doc>, props: Opt<FieldViewProps & DocumentViewProps>, property: string) {
     const remoteDocHeader = 'author;author_date;noMargin';
     const isCaption = property.includes(':caption');
-    const isAnchor = property.includes(':anchor');
     const isNonTransparent = property.includes(':nonTransparent');
     const isNonTransparentLevel = isNonTransparent ? Number(property.replace(/.*:nonTransparent([0-9]+).*/, '$1')) : 0; // property.includes(':nonTransparent');
     const isAnnotated = property.includes(':annotated');
@@ -251,14 +250,16 @@ export function DefaultStyleProvider(doc: Opt<Doc>, props: Opt<FieldViewProps &
             const dataKey = doc ? Doc.LayoutDataKey(doc) : '';
             const usePath = StrCast(doc?.[dataKey + '_usePath']);
             const alternate = usePath.includes(':hover') ? ( isHovering?.() ? '_' + usePath.replace(':hover','') : '') : usePath ? "_" +usePath:usePath;
-            let docColor:Opt<string> = layoutDoc &&
-                StrCast(alternate ? layoutDoc['backgroundColor' + alternate]:undefined,
+            const colorKey = doc?.layout_isSvg ? "fillColor" : "backgroundColor";
+            const docColorFn = (key: string) => layoutDoc &&
+                StrCast(alternate ? layoutDoc[key + alternate]:undefined,
                     DocCast(doc.rootDocument)
-                        ? StrCast(layoutDoc.backgroundColor, StrCast(DocCast(doc.rootDocument)!.backgroundColor))  // for nested templates: use template's color, then root doc's color
+                        ? StrCast(layoutDoc[key], StrCast(DocCast(doc.rootDocument)![key]))  // for nested templates: use template's color, then root doc's color
                         : layoutDoc === doc 
-                            ? StrCast(doc.backgroundColor)
-                            : StrCast(StrCast(Doc.GetT(layoutDoc, 'backgroundColor', 'string', true), StrCast(doc.backgroundColor, StrCast(layoutDoc.backgroundColor)) // otherwise, use expanded template coloor, then root doc's color, then template's inherited color
-                    )));
+                            ? StrCast(doc[key])
+                            : StrCast(StrCast(Doc.GetT(layoutDoc, key, 'string', true), StrCast(doc[key], StrCast(layoutDoc[key])) // otherwise, use expanded template coloor, then root doc's color, then template's inherited color
+                    )))
+            let docColor = docColorFn(colorKey);
         
             // prettier-ignore
             switch (layoutDoc?.type) {
@@ -266,11 +267,11 @@ export function DefaultStyleProvider(doc: Opt<Doc>, props: Opt<FieldViewProps &
                 case DocumentType.PRES:        docColor = docColor || 'transparent'; break;
                 case DocumentType.FONTICON:    docColor = boxBackground ? undefined : docColor || SnappingManager.userBackgroundColor; break;
                 case DocumentType.RTF:         docColor = docColor || StrCast(Doc.UserDoc().textBackgroundColor, Colors.LIGHT_GRAY); break;
-                case DocumentType.LINK:        docColor = (isAnchor ? docColor : undefined); break;
                 case DocumentType.INK:         docColor = doc?.stroke_isInkMask ? 'rgba(0,0,0,0.7)' : undefined; break;
                 case DocumentType.EQUATION:    docColor = docColor || StrCast(Doc.UserDoc().textBackgroundColor, 'transparent'); break;
                 case DocumentType.LABEL:       docColor = docColor || Colors.LIGHT_GRAY; break;
                 case DocumentType.BUTTON:      docColor = docColor || Colors.LIGHT_GRAY; break;
+                case DocumentType.LINK:        docColor = docColor || docColorFn('backgroundColor'); break;
                 case DocumentType.IMG:
                 case DocumentType.WEB:
                 case DocumentType.PDF:
-- 
cgit v1.2.3-70-g09d2

