Closed
Bug 514745
Opened 15 years ago
Closed 15 years ago
Implement resizer themeing from bug 510333 for rtl
Categories
(Core :: Widget: Cocoa, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.9.3a1
People
(Reporter: enndeakin, Assigned: mstange)
References
Details
(Keywords: rtl)
Attachments
(1 file)
16.99 KB,
patch
|
jaas
:
review+
|
Details | Diff | Splinter Review |
I've tried but cannot get the image drawn to appear in reverse. The folowing code doesn't seem to work:
+ CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
+ CGContextRef bitmapctx = CGBitmapContextCreate(NULL,
+ (size_t) ceil(macRect.size.width),
+ (size_t) ceil(macRect.size.height),
+ 8,
+ (size_t) ceil(macRect.size.width) * 4,
+ colorSpace,
+ kCGImageAlphaPremultipliedFirst);
+ CGColorSpaceRelease(colorSpace);
+ HIPoint pnt = { 0, 0 };
+ HIThemeDrawGrowBox(&pnt, &drawInfo, bitmapctx, kHIThemeOrientationNormal);
+
+ CGAffineTransform ctm = CGContextGetCTM(cgContext);
+ CGImageRef bitmap = CGBitmapContextCreateImage(bitmapctx);
+
+ CGContextTranslateCTM(cgContext, macRect.size.width, macRect.size.height);
+ CGContextScaleCTM(cgContext, -1.0f, -1.0f);
+
+ CGContextDrawImage(cgContext, macRect, bitmap);
+ CGContextSetCTM(cgContext, ctm);
+ CGImageRelease(bitmap);
+ CGContextRelease(bitmapctx);
I've tried many different variations of arguments passed to the translate and scale methods as well as to the structure of the code, but nothing seems to work.
Assignee | ||
Updated•15 years ago
|
Assignee: nobody → mstange
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•15 years ago
|
||
I think the problem with your code is that you pass macRect into CGContextDrawImage, which still has the original x and y position. The flip transform that you set gets applied to these coordinates, too, so the image will end up in a completely wrong place.
My patch gets around that by pushing a translation transform first, then pushing the flip transform, and then drawing the image at the position 0,0.
Assignee | ||
Comment 2•15 years ago
|
||
This patch fixes the scrollbar drawing code (and thus bug 492155), generalizes it to take a rendering callback function and uses the generalized implementation to draw resizers.
I don't know if the reftests pass on other platforms; the tryserver seems very unhappy right now so I'll ask him again tomorrow.
Attachment #402551 -
Flags: review?(joshmoz)
Reporter | ||
Comment 3•15 years ago
|
||
This works great!
Attachment #402551 -
Flags: review?(joshmoz) → review+
Assignee | ||
Comment 4•15 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/074779c640fb
(Transformed scrollbars are bug 492155.)
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a1
Assignee | ||
Updated•15 years ago
|
Attachment #402551 -
Flags: approval1.9.2?
Assignee | ||
Comment 5•15 years ago
|
||
Oops, transformed scrollbars are still bug 492155... I mentioned the wrong bug in the 1.9.2 commit message, too.
Comment 6•15 years ago
|
||
Comment on attachment 402551 [details] [diff] [review]
v1
approval1.9.2 requests aren't currently being monitored, since we're nearing RC freeze and there are too many outstanding requests, so I'm clearing this request. Feel free to re-request approval if you are confident that it's worth drivers' time to consider whether this non-blocker needs to land for 1.9.2 at this stage.
Attachment #402551 -
Flags: approval1.9.2?
You need to log in
before you can comment on or make changes to this bug.
Description
•