From f1fb376bdfdb45af5aaea4a4462d1dd23e9cda3a Mon Sep 17 00:00:00 2001 From: LEO Yoon-Tsaw Date: Sun, 5 Jun 2022 11:26:18 -0400 Subject: [PATCH] Fix border bug --- SquirrelPanel.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/SquirrelPanel.m b/SquirrelPanel.m index c7108f296..ff1fb7b0c 100644 --- a/SquirrelPanel.m +++ b/SquirrelPanel.m @@ -850,8 +850,6 @@ - (void)drawRect:(NSRect)dirtyRect { } CAShapeLayer *panelLayer = shapeFromPath(backPath); panelLayer.fillColor = theme.backgroundColor.CGColor; - panelLayer.lineWidth = theme.borderWidth; - panelLayer.strokeColor = theme.borderColor.CGColor; CAShapeLayer *panelLayerMask = shapeFromPath(backgroundPath); panelLayer.mask = panelLayerMask; [self.layer addSublayer: panelLayer]; @@ -867,6 +865,13 @@ - (void)drawRect:(NSRect)dirtyRect { layer.mask = mask; [panelLayer addSublayer: layer]; } + if (theme.borderWidth > 0 && theme.borderColor) { + CAShapeLayer *borderLayer = shapeFromPath(backgroundPath); + borderLayer.lineWidth = theme.borderWidth * 2; + borderLayer.strokeColor = theme.borderColor.CGColor; + borderLayer.fillColor = NULL; + [panelLayer addSublayer: borderLayer]; + } if (theme.highlightedPreeditColor && !CGPathIsEmpty(highlightedPreeditPath)) { CAShapeLayer *layer = shapeFromPath(highlightedPreeditPath); layer.fillColor = theme.highlightedPreeditColor.CGColor;