From 4a7afb246dd98e40d9e792f80fa57b972e77f324 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Fri, 5 Nov 2021 21:45:54 +0200 Subject: [PATCH] Fix some oopsies --- Cocoa/GBHueSliderCell.m | 2 +- Cocoa/GBPaletteEditorController.m | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cocoa/GBHueSliderCell.m b/Cocoa/GBHueSliderCell.m index 7f0bd82..11fdc09 100644 --- a/Cocoa/GBHueSliderCell.m +++ b/Cocoa/GBHueSliderCell.m @@ -48,7 +48,7 @@ [super drawKnob:knobRect]; NSRect peekRect = knobRect; peekRect.size.width /= 2; - peekRect.size.height /= 2; + peekRect.size.height = peekRect.size.width; peekRect.origin.x += peekRect.size.width / 2; peekRect.origin.y += peekRect.size.height / 2; NSColor *color = self.colorValue; diff --git a/Cocoa/GBPaletteEditorController.m b/Cocoa/GBPaletteEditorController.m index 5df4aef..0a613fb 100644 --- a/Cocoa/GBPaletteEditorController.m +++ b/Cocoa/GBPaletteEditorController.m @@ -148,7 +148,7 @@ static double blend(double from, double to, double position) return; } NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - NSMutableDictionary *themes = [[defaults dictionaryForKey:@"GBThemes"] ?: @[] mutableCopy]; + NSMutableDictionary *themes = [[defaults dictionaryForKey:@"GBThemes"] ?: @{} mutableCopy]; NSString *newName = object; unsigned i = 2; if (!newName.length) { @@ -171,7 +171,7 @@ static double blend(double from, double to, double position) { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSString *name = [defaults stringForKey:@"GBCurrentTheme"]; - NSMutableDictionary *themes = [[defaults dictionaryForKey:@"GBThemes"] ?: @[] mutableCopy]; + NSMutableDictionary *themes = [[defaults dictionaryForKey:@"GBThemes"] ?: @{} mutableCopy]; [themes removeObjectForKey:name]; [defaults setObject:themes forKey:@"GBThemes"]; [_themesList reloadData]; @@ -267,7 +267,7 @@ static double blend(double from, double to, double position) @"HueBiasStrength": @(_hueStrengthSlider.doubleValue / 256.0) }; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - NSMutableDictionary *themes = [[defaults dictionaryForKey:@"GBThemes"] ?: @[] mutableCopy]; + NSMutableDictionary *themes = [[defaults dictionaryForKey:@"GBThemes"] ?: @{} mutableCopy]; themes[[defaults stringForKey:@"GBCurrentTheme"]] = theme; [defaults setObject:themes forKey:@"GBThemes"]; [[NSNotificationCenter defaultCenter] postNotificationName:@"GBColorPaletteChanged" object:nil];