mirror of
https://github.com/qvacua/vimr.git
synced 2024-12-29 16:56:40 +03:00
Use offsetBy instead of custom translating
This commit is contained in:
parent
c5974abd63
commit
689fc8d0a3
@ -17,10 +17,6 @@ extension CGRect: Hashable {
|
||||
size: CGSize(width: self.size.width + dw, height: self.size.height + dh))
|
||||
}
|
||||
|
||||
public func translating(x: CGFloat, y: CGFloat) -> CGRect {
|
||||
return CGRect(origin: CGPoint(x: self.origin.x + x, y: self.origin.y + y), size: self.size)
|
||||
}
|
||||
|
||||
func scaling(_ factor: CGFloat) -> CGRect {
|
||||
return CGRect(origin: self.origin.scaling(factor), size: self.size.scaling(factor))
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ extension NeoVimView {
|
||||
let rectToScroll = self.rect(for: self.grid.region)
|
||||
let clipRect: CGRect
|
||||
if count > 0 {
|
||||
clipRect = rectToScroll.translating(x: 0, y: offset).resizing(dw: 0, dh: -offset)
|
||||
clipRect = rectToScroll.offsetBy(dx: 0, dy: offset).resizing(dw: 0, dh: -offset)
|
||||
} else {
|
||||
clipRect = rectToScroll.resizing(dw: 0, dh: offset)
|
||||
}
|
||||
@ -149,7 +149,7 @@ extension NeoVimView {
|
||||
public func put(_ string: String, screenCursor: Position) {
|
||||
gui.async {
|
||||
let curPos = self.grid.putPosition
|
||||
self.bridgeLogger.debug("\(curPos) -> '\(string)' <- screen: \(screenCursor)")
|
||||
// self.bridgeLogger.debug("\(curPos) -> '\(string)' <- screen: \(screenCursor)")
|
||||
|
||||
self.grid.put(string)
|
||||
|
||||
@ -286,7 +286,7 @@ extension NeoVimView {
|
||||
|
||||
public func autoCommandEvent(_ event: NeoVimAutoCommandEvent, bufferHandle: Int) {
|
||||
gui.async {
|
||||
self.bridgeLogger.debug("\(neoVimAutoCommandEventName(event)) -> \(bufferHandle)")
|
||||
// self.bridgeLogger.debug("\(neoVimAutoCommandEventName(event)) -> \(bufferHandle)")
|
||||
|
||||
if event == .BUFWINENTER || event == .BUFWINLEAVE {
|
||||
self.bufferListChanged()
|
||||
|
Loading…
Reference in New Issue
Block a user