Closed Bug 384569 Opened 17 years ago Closed 17 years ago

When drawing to a scaled canvas with drawWindow, native buttons are enormous

Categories

(Core :: Widget: Cocoa, defect, P4)

x86
macOS
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: mossop, Assigned: jaas)

References

Details

Attachments

(2 files)

Attached image screenshot
The rest of the window draws in the canvas correctly, but the buttons are massive.
Summary: What drawing to a scaled canvas with drawWindow, native buttons are enormous → When drawing to a scaled canvas with drawWindow, native buttons are enormous
this is a dupe of some other bug whose number I forgot --- basically, Cocoa native theming needs to do what Linux and Windows do, if a non-trivial transform is in effect, render via a temporary surface.
Assignee: joshmoz → cbarrett
This is an artifact of us using the compositeToPoint: method instead of drawAtPoint:.

I'll come up with a fix for this next week.
I think we should fix this by:

1) removing our use of an offscreen buffer to draw scaled buttons
2) instead do something like:

gSave
SetScale(scaleFactor /* we already compute this */)
Draw
gRestore

This would also make my patch for bug 397209 unneeded.
I tried this idea out the other day and HITheme barfed. D'oh :(

Good news is that NSCell works fine.
Flags: blocking1.9+
Target Milestone: --- → mozilla1.9 M10
Target Milestone: mozilla1.9 M10 → mozilla1.9 M11
Priority: -- → P4
Target Milestone: mozilla1.9 M11 → ---
Assignee: cbarrett → joshmoz
This is a testcase to demonstrate the issue. Since it uses the drawWindow call you must run it from a local disk and it will ask for elevated privileges on load.

It contains a 400x400 area at the top of the page with some text and buttons. Below is a 200x200 canvas. The top area is scaled down and drawn onto the canvas.

The button widgets draw as if there was no scaling at all, the text (including the text labels of the buttons) are correctly scaled.
Depends on: 407093
fixed by 407093
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: