mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-10-26 19:10:11 +03:00
Fix checkmark in line spacing menu
This commit is contained in:
parent
be7ec8e664
commit
8d60d1c22b
@ -59,6 +59,7 @@ Change Log
|
||||
- Fix an issue that Unicode character insertion was occasionally failed.
|
||||
- Fix an issue that syntax highlights were removed after perform Unhighlight.
|
||||
- Fix timing to display sheets on file open.
|
||||
- Fix an issue that checkmark in line height menu was not displayed.
|
||||
- Fix some missing localizations in simplified Chinese. (Thanks to Wei Wang!)
|
||||
- Fix an issue that an alert message was not localized.
|
||||
- And other trivial UI fixes and enhancements.
|
||||
|
@ -951,7 +951,8 @@ static NSPoint kTextContainerOrigin;
|
||||
// (カラーコード編集メニューは常に有効)
|
||||
|
||||
} else if ([menuItem action] == @selector(changeLineHeight:)) {
|
||||
[menuItem setState:(([self lineSpacing] == (CGFloat)[[menuItem title] doubleValue] - 1.0) ? NSOnState : NSOffState)];
|
||||
CGFloat lineSpacing = [[menuItem title] doubleValue] - 1.0;
|
||||
[menuItem setState:(CEIsEqualCGFloats([self lineSpacing], lineSpacing, 3) ? NSOnState : NSOffState)];
|
||||
} else if ([menuItem action] == @selector(changeTabWidth:)) {
|
||||
[menuItem setState:(([self tabWidth] == [menuItem tag]) ? NSOnState : NSOffState)];
|
||||
} else if ([menuItem action] == @selector(showSelectionInfo:)) {
|
||||
|
@ -70,6 +70,11 @@ typedef NS_ENUM(UInt32, CESystemSoundID) {
|
||||
};
|
||||
|
||||
|
||||
// convenient functions
|
||||
/// compare CGFloats
|
||||
BOOL CEIsEqualCGFloats(CGFloat float1, CGFloat float2, NSInteger accuracy);
|
||||
|
||||
|
||||
|
||||
#pragma mark Notifications
|
||||
|
||||
|
@ -70,6 +70,15 @@ NSString *const kHelpAnchors[] = {
|
||||
@"pref_integration"
|
||||
};
|
||||
|
||||
|
||||
// convenient functions
|
||||
/// compare CGFloats
|
||||
BOOL CEIsEqualCGFloats(CGFloat float1, CGFloat float2, NSInteger accuracy) {
|
||||
return (fabs(float1 - float2) < pow(10, -accuracy));
|
||||
}
|
||||
|
||||
|
||||
|
||||
#pragma mark Notifications
|
||||
|
||||
// ------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user