qgis/QGIS — pull request #1300 by manisandro (2014-04-08 14:18:37+00:00)
Title: Improve print composer arrow bounding box logic

Currently, `setSceneRect` does not directly set the bounding box, but first adjusts the arrow endpoints, and then adjusts the bounding box accordingly. A consequence of this is that when the user adapts the bounding box dimensions in the `Item properties` -> ` Position and size` UI, the entered values will not be exactly equal to the resulting bounding box size (i.e. if the user enters 200 for width, the bounding box will end up being wide i.e. 199.738, depending on the previous size). The cause of this is that the marker size which do not scale proportionally to the bounding box size (whereas the code attempts to reposition the endpoints by keeping the relative position of the endpoints within the bounding box constant).

This patch reworks the bounding box logic. Now, the bounding box is resized first, and then the arrow endpoints are repositioned appropriately inside the bounding box. This also has the advantage that, when changing marker symbol, the bounding box does not change (except when the bounding box is too small to contain the marker symbol). This patch also ensures the bounding box is correctly updated when the marker symbol changes.