Fix conversion from wxColour to NSColor in wxOSX/Cocoa wxDVC.

wxColour components are in 0.255 range while NSColor ones are in 0..1 one. The
old code compiled just fine but didn't work correctly for any colours which
had any channel with value different from 0 and 255 (unsurprisingly, my tests
only used wxRED, wxGREEN and wxBLUE which all passed...).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62396 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-10-12 22:44:23 +00:00
parent 38c349189a
commit f115ff4a4f

View File

@@ -1547,10 +1547,10 @@ wxWidgetImplType* CreateDataView(wxWindowMac* wxpeer, wxWindowMac* WXUNUSED(pare
}
const wxColour& c = attr.GetColour();
colText = [NSColor colorWithDeviceRed:c.Red()
green:c.Green()
blue:c.Blue()
alpha:c.Alpha()];
colText = [NSColor colorWithDeviceRed:c.Red() / 255.
green:c.Green() / 255.
blue:c.Blue() / 255.
alpha:c.Alpha() / 255.];
}
}
}