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

RESOLVED FIXED

Status

()

Core
Widget: Cocoa
P4
normal
RESOLVED FIXED
11 years ago
10 years ago

People

(Reporter: mossop, Assigned: Josh Aas)

Tracking

Trunk
x86
Mac OS X
Points:
---
Bug Flags:
blocking1.9 +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

11 years ago
Created attachment 268474 [details]
screenshot

The rest of the window draws in the canvas correctly, but the buttons are massive.

Updated

11 years ago
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.
(Assignee)

Updated

11 years ago
Flags: blocking1.9+
(Assignee)

Updated

11 years ago
Target Milestone: --- → mozilla1.9 M10
(Assignee)

Updated

10 years ago
Target Milestone: mozilla1.9 M10 → mozilla1.9 M11
(Assignee)

Updated

10 years ago
Priority: -- → P4
Target Milestone: mozilla1.9 M11 → ---
(Assignee)

Updated

10 years ago
Assignee: cbarrett → joshmoz
(Reporter)

Comment 5

10 years ago
Created attachment 291794 [details]
testcase (save locally to run)

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.
(Assignee)

Updated

10 years ago
Depends on: 407093
(Assignee)

Comment 6

10 years ago
fixed by 407093
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.