Ticket #263 (closed defect: duplicate)
Wrong calculation for dialog position
| Reported by: | agsel | Owned by: | somebody |
|---|---|---|---|
| Priority: | important | Milestone: | |
| Component: | Other | Version: | 1.0.0 Stable |
| Keywords: | QDialogBox, control_dialog.js | Cc: |
Description
control_dialog.js
row 136-137:
var intTop = Math.round((Math.max(qcodo.client.height, qcodo.page.height) - intHeight) / 2) + qcodo.scroll.y; var intLeft = Math.round(Math.max((qcodo.client.width, qcodo.page.width) - intWidth) / 2) + qcodo.scroll.x;
probably should be (and works for me):
var intTop = Math.round((Math.min(qcodo.client.height, qcodo.page.height) - intHeight) / 2) + qcodo.scroll.y; var intLeft = Math.round((Math.min(qcodo.client.width, qcodo.page.width) - intWidth) / 2) + qcodo.scroll.x;
Notice the "max" => "min" change. If you look at the rows 91-92 (resize handling), there is the same calculation used.
Also, notice the change of "(" for "var intLeft" calculation. Though changing it didn't change anything, I guess the correction should be done? (the same fix has to be done to rows 91-92).
If you think that those changes are good, I can create a patch.
Change History
Note: See
TracTickets for help on using
tickets.
