From 065b3738bd511c10e5511ca0a35c535090a33aee Mon Sep 17 00:00:00 2001 From: Takayama Fumihiko Date: Thu, 7 Dec 2023 23:52:11 +0900 Subject: [PATCH] Fix MultitouchExtension/IgnoredAreaView.swift corruption in macOS 11 --- .../src/Views/Settings/IgnoredAreaView.swift | 97 ++++++++++--------- 1 file changed, 49 insertions(+), 48 deletions(-) diff --git a/src/apps/MultitouchExtension/src/Views/Settings/IgnoredAreaView.swift b/src/apps/MultitouchExtension/src/Views/Settings/IgnoredAreaView.swift index cb96738f4..c27dc834d 100644 --- a/src/apps/MultitouchExtension/src/Views/Settings/IgnoredAreaView.swift +++ b/src/apps/MultitouchExtension/src/Views/Settings/IgnoredAreaView.swift @@ -56,42 +56,40 @@ struct IgnoredAreaView: View { .frame(width: areaWidth, height: areaHeight) .padding(.leading, areaLeading) .padding(.top, areaTop) - .overlay( - Group { - Path { path in - path.addLines([ - CGPoint(x: areaX50, y: areaTop), - CGPoint(x: areaX50, y: areaTop + areaHeight), - ]) - - path.addLines([ - CGPoint(x: areaLeading, y: areaY50), - CGPoint(x: areaLeading + areaWidth, y: areaY50), - ]) - }.stroke(.black, lineWidth: 1) - - Path { path in - path.addLines([ - CGPoint(x: areaX25, y: areaTop), - CGPoint(x: areaX25, y: areaTop + areaHeight), - ]) - - path.addLines([ - CGPoint(x: areaX75, y: areaTop), - CGPoint(x: areaX75, y: areaTop + areaHeight), - ]) - - path.addLines([ - CGPoint(x: areaLeading, y: areaY25), - CGPoint(x: areaLeading + areaWidth, y: areaY25), - ]) - - path.addLines([ - CGPoint(x: areaLeading, y: areaY75), - CGPoint(x: areaLeading + areaWidth, y: areaY75), - ]) - }.stroke(.black, style: StrokeStyle(lineWidth: 1, dash: [2])) - }) + + Path { path in + path.addLines([ + CGPoint(x: areaX50, y: areaTop), + CGPoint(x: areaX50, y: areaTop + areaHeight), + ]) + + path.addLines([ + CGPoint(x: areaLeading, y: areaY50), + CGPoint(x: areaLeading + areaWidth, y: areaY50), + ]) + }.stroke(.black, lineWidth: 1) + + Path { path in + path.addLines([ + CGPoint(x: areaX25, y: areaTop), + CGPoint(x: areaX25, y: areaTop + areaHeight), + ]) + + path.addLines([ + CGPoint(x: areaX75, y: areaTop), + CGPoint(x: areaX75, y: areaTop + areaHeight), + ]) + + path.addLines([ + CGPoint(x: areaLeading, y: areaY25), + CGPoint(x: areaLeading + areaWidth, y: areaY25), + ]) + + path.addLines([ + CGPoint(x: areaLeading, y: areaY75), + CGPoint(x: areaLeading + areaWidth, y: areaY75), + ]) + }.stroke(.black, style: StrokeStyle(lineWidth: 1, dash: [2])) ForEach(fingerManager.states) { state in if state.touchedPhysically || state.touchedFixed || state.palmed { @@ -107,7 +105,7 @@ struct IgnoredAreaView: View { if state.touchedFixed { Circle() .fill(color) - .frame(width: diameter) + .frame(width: diameter, height: diameter) .padding(.leading, leading) .padding(.top, top) } @@ -115,20 +113,23 @@ struct IgnoredAreaView: View { let palmThresholdLeading = areaSize.width * state.point.x - (thresholdDiameter / 2) let palmThresholdTop = areaSize.height * (1.0 - state.point.y) - (thresholdDiameter / 2) - VStack { - Circle() - .stroke( - !state.touchedFixed ? Color.black : (state.palmed ? Color.gray : palmedColor), - style: StrokeStyle(lineWidth: 2) - ) - .frame(width: thresholdDiameter) - Text("\(String(format: "%.1f", state.size))") - } - .padding(.leading, palmThresholdLeading) - .padding(.top, palmThresholdTop) + + Circle() + .stroke( + !state.touchedFixed ? Color.black : (state.palmed ? Color.gray : palmedColor), + style: StrokeStyle(lineWidth: 2) + ) + .frame(width: thresholdDiameter, height: thresholdDiameter) + .padding(.leading, palmThresholdLeading) + .padding(.top, palmThresholdTop) + + Text("\(String(format: "%.1f", state.size))") + .padding(.leading, palmThresholdLeading) + .padding(.top, palmThresholdTop + thresholdDiameter) } } } + .frame(width: areaSize.width, height: areaSize.height) VStack { Text("Ignored")