Skip to content

Commit

Permalink
[Bugfix] Update label width calculation logic (tisfeng#198)
Browse files Browse the repository at this point in the history
When scrollbar is enabled, there is an extra 11 width.
  • Loading branch information
Kyle-Ye authored Oct 27, 2023
1 parent 1d4dab0 commit 9b02749
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -910,10 +910,7 @@ - (void)updateTagButton:(NSButton *)tagButton tagColor:(NSColor *)tagColor {

- (CGSize)labelSize:(EZLabel *)label exceptedWidth:(CGFloat)exceptedWidth {
// ???: 很奇怪,比如实际计算结果为 364,但界面渲染却是 364.5 😑

NSWindow *window = [self windowOfType:self.result.service.windowType];
CGFloat selfWidth = window ? window.width - EZHorizontalCellSpacing_10 * 2 : self.width;
CGFloat width = selfWidth - exceptedWidth;
CGFloat width = self.width - exceptedWidth;
// NSLog(@"text: %@, width: %@", label.text, @(width));
// NSLog(@"self.width: %@, selfWidth: %@", @(self.width), @(selfWidth));

Expand Down

0 comments on commit 9b02749

Please sign in to comment.