Repo // Disable NSRect.zero to suppress CoreGraphics errors.
This commit is contained in:
parent
4527e6f7ba
commit
a846022f1b
|
@ -16,7 +16,7 @@ extension ctlInputMethod: KeyHandlerDelegate {
|
|||
/// 記錄當前輸入環境是縱排輸入還是橫排輸入。
|
||||
public var isVerticalTyping: Bool {
|
||||
guard let client = client() else { return false }
|
||||
var textFrame = NSRect.zero
|
||||
var textFrame = NSRect.seniorTheBeast
|
||||
let attributes: [AnyHashable: Any]? = client.attributes(
|
||||
forCharacterIndex: 0, lineHeightRectangle: &textFrame
|
||||
)
|
||||
|
|
|
@ -160,7 +160,7 @@ public class ctlCandidate: NSWindowController, ctlCandidateProtocol {
|
|||
|
||||
var adjustedPoint = windowTopLeftPoint
|
||||
var delta = heightDelta
|
||||
var screenFrame = NSScreen.main?.visibleFrame ?? NSRect.zero
|
||||
var screenFrame = NSScreen.main?.visibleFrame ?? NSRect.seniorTheBeast
|
||||
for frame in NSScreen.screens.map(\.visibleFrame).filter({ !$0.contains(windowTopLeftPoint) }) {
|
||||
screenFrame = frame
|
||||
break
|
||||
|
|
|
@ -167,7 +167,7 @@ public class ctlCandidateIMK: IMKCandidates, ctlCandidateProtocol {
|
|||
var adjustedPoint = windowTopLeftPoint
|
||||
var adjustedHeight = height
|
||||
|
||||
var screenFrame = NSScreen.main?.visibleFrame ?? NSRect.zero
|
||||
var screenFrame = NSScreen.main?.visibleFrame ?? NSRect.seniorTheBeast
|
||||
for screen in NSScreen.screens {
|
||||
let frame = screen.visibleFrame
|
||||
if windowTopLeftPoint.x >= frame.minX, windowTopLeftPoint.x <= frame.maxX,
|
||||
|
|
|
@ -600,7 +600,7 @@ extension ctlCandidateUniversal {
|
|||
pageCounterLabel.isHidden = true
|
||||
}
|
||||
|
||||
frameRect = window?.frame ?? NSRect.zero
|
||||
frameRect = window?.frame ?? NSRect.seniorTheBeast
|
||||
|
||||
let topLeftPoint = NSPoint(x: frameRect.origin.x, y: frameRect.origin.y + frameRect.size.height)
|
||||
frameRect.size = newSize
|
||||
|
|
|
@ -90,7 +90,7 @@ public class NotifierController: NSWindowController, NotifierWindowDelegate {
|
|||
}
|
||||
|
||||
private init() {
|
||||
let screenRect = NSScreen.main?.visibleFrame ?? NSRect.zero
|
||||
let screenRect = NSScreen.main?.visibleFrame ?? NSRect.seniorTheBeast
|
||||
let contentRect = NSRect(x: 0, y: 0, width: kWindowWidth, height: kWindowHeight)
|
||||
var windowRect = contentRect
|
||||
windowRect.origin.x = screenRect.maxX - windowRect.width - 10
|
||||
|
@ -144,8 +144,8 @@ public class NotifierController: NSWindowController, NotifierWindowDelegate {
|
|||
return
|
||||
}
|
||||
let lastLocation = NotifierController.lastLocation
|
||||
let screenRect = NSScreen.main?.visibleFrame ?? NSRect.zero
|
||||
var windowRect = window?.frame ?? NSRect.zero
|
||||
let screenRect = NSScreen.main?.visibleFrame ?? NSRect.seniorTheBeast
|
||||
var windowRect = window?.frame ?? NSRect.seniorTheBeast
|
||||
windowRect.origin.x = lastLocation.x
|
||||
windowRect.origin.y = lastLocation.y - 10 - windowRect.height
|
||||
|
||||
|
@ -157,7 +157,7 @@ public class NotifierController: NSWindowController, NotifierWindowDelegate {
|
|||
}
|
||||
|
||||
func moveIn() {
|
||||
let afterRect = window?.frame ?? NSRect.zero
|
||||
let afterRect = window?.frame ?? NSRect.seniorTheBeast
|
||||
NotifierController.lastLocation = afterRect.origin
|
||||
var beforeRect = afterRect
|
||||
beforeRect.origin.y += 10
|
||||
|
|
|
@ -129,7 +129,7 @@ public class ctlTooltip: NSWindowController {
|
|||
|
||||
var adjustedPoint = windowTopLeftPoint
|
||||
var delta = heightDelta
|
||||
var screenFrame = NSScreen.main?.visibleFrame ?? NSRect.zero
|
||||
var screenFrame = NSScreen.main?.visibleFrame ?? NSRect.seniorTheBeast
|
||||
for frame in NSScreen.screens.map(\.visibleFrame).filter({ !$0.contains(windowTopLeftPoint) }) {
|
||||
screenFrame = frame
|
||||
break
|
||||
|
|
Loading…
Reference in New Issue