Ticket #263 (closed defect: duplicate)

Opened 16 months ago

Last modified 16 months ago

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

Changed 16 months ago by VexedPanda

  • status changed from new to closed
  • resolution set to duplicate

#131 was re-opened to address this, and a patch would be welcome. :)

Note: See TracTickets for help on using tickets.