The same font, in the same point size, can be displayed differently
depending on platform (this is a Qt limitation). This can lead to text
items being the wrong size when importing a document created on a
different computer.
As a workaround, when saving a text item to SVG, the size of 1pt in
pixels is calculated and saved. Upon loading, this value is calculated
again and, if it is different from the saved value, the text item is
scaled accordingly.
Thus, any document created from this version onward will have
correctly-scaled text boxes. If an old document (not containing a
pixel-per-point attribute for text items) is loaded, the scene is marked
as modified to make sure that all text items are then saved with the
pixels-per-point value (even if the document is not edited). This allows
old documents to be "fixed" by simply opening them once from a new
version of OpenBoard.
save text item font size in pixels, and scale it on load
fixed loading of text item pixel height
Save and load pixels-per-point rather than text pixel height
Upon loading a text item from SVG, make sure that it will be saved with a pixel-per-point value
This fixes an issue where if one document was imported with a different
DPI than the current one, any document created thereafter would have
this same value (which could then cause problems if a PDF was added to
that new document).
Saving this value to UBDocumentProxy not only makes more sense, it also
fixes this issue.
- Removed inheritance of UBGraphicsProxyWidget; cleaned up related code
- Added two children classes: UBGraphicsVideoItem and
UBGraphicsAudioItem. UBGraphicsMediaItem is now an abstract class.
- Better encapsulation; the Scene and other external classes no longer
access the mediaObject directly
There is now less distinction between audio and video items to outside
code: apart from the UBSvgSubsetAdaptor, there is no need to know
whether a media item holds a video or audio file. Creation is handled
through the static function `UBGraphicsMediaItem::createMediaItem(URL,
parent)`