hpennington / NSSwitch

UISwitch for macOS.
MIT License
37 stars 2 forks source link

ThumbView has incorrect position for some cases #4

Open IlyaBaudin opened 3 years ago

IlyaBaudin commented 3 years ago

Bug description: ThumbView has incorrect position for some cases.

Steps to reproduce:

  1. Make an NSSwitch Outlet to NSViewController
  2. Predefine default value for NSSwitch is ON
  3. Call .setOn(on: true, animated: false)
  4. In this case bgView color changed, but thumbView position will not changed and it always use OFF (left) position.
IlyaBaudin commented 3 years ago

I made a pull request. Changes should fix this issue. @hpennington please take a look.

https://github.com/hpennington/NSSwitch/pull/3