-
Notifications
You must be signed in to change notification settings - Fork 806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-[NSString drawAtPoint:withAttributes:] regression #1335
Comments
@edvv thanks for reporting the issue. what exactly is messed up? Wrong color or color not set? |
When the text color is suppose to be black, it looks mostly cyan. The blue channel seems to be at maximum all of the time and the other channels seem somewhat "inverted". It is more complex than I thought because I can't repro it in a simple test app. It seems like a font bitmap compositing bug such as attempting to composite a font raster cache into a buffer of different raster cache type. It only happens with custom string drawing, the labels for buttons (UIButton) are the correct color (black). I reverted to release 41 and that release draws the font colors as expected. |
@rajsesh-msft I am currently using this: -[NSString drawAtPoint:withAttributes:] which is drawing to UIGraphicsGetCurrentContext() - nothing fancy. So, drawing directly to the display device. I think the issues you cited are very consistent with what I am seeing. |
@edvv, we have this code in WOCCatalog (TextDisplayViewController), which works correctly. What are you performing the custom drawing into? Are you using a middleware like cocos2d? Thanks again for helping investigate it, unfortunately, I am unable to repro the issue. |
@rajsesh-msft Attached is a small unit test demonstrating the error. On iOS the text is red color. On Windows (with WinObjC release 42) the text is cyan-ish in the white rectangle portion and green-ish in the black (alpha) portion. I constructed the test to duplicate a backstore promotion to demonstrate the error, i.e.: one of the drawing elements is promoting the backstore into something the glyph rendering does not like. It may be the layer promotion, scrollview, image with alpha channel or opaque or alpha method override. Sincerely, Ed |
@edvv thanks for taking time to provide the simple sample. Much appreciated. |
…xel format, in this case, XBGR. Fixes microsoft#1335.
Dear WinObjC Engineers,
From release 41 to 42 there is a regression in -[NSString drawAtPoint:withAttributes:]. The color attribute perhaps worked in 41, but in 42 the color attribute is all messed up. Here is a code frag that executes the bug:
stringAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:[UIFont systemFontOfSize:12.0], NSFontAttributeName, [UIColor redColor], NSForegroundColorAttributeName, nil];
[aString drawAtPoint:aPoint withAttributes:stringAttributes];
Sincerely,
Ed
The text was updated successfully, but these errors were encountered: