123456789101112131415161718192021222324 |
- //
- // KMTextFieldCell.swift
- // PDF Reader Pro
- //
- // Created by liujiajie on 2024/1/11.
- //
- import Cocoa
- class KMTextFieldCell: NSTextFieldCell{
- override func drawingRect(forBounds rect: NSRect) -> NSRect {
- var newRect:NSRect = super.drawingRect(forBounds: rect)
- let textSize:NSSize = self.cellSize(forBounds: rect)
- let heightDelta:CGFloat = newRect.size.height - textSize.height
- if heightDelta > 0 {
- newRect.size.height = textSize.height
- newRect.origin.y += heightDelta * 0.5
- }
- newRect.origin.x += 3
- return newRect
- }
- }
|