Code Monkey home page Code Monkey logo

Comments (1)

watsaig avatar watsaig commented on June 14, 2024

(Should be fixed, but commenting for future me or future whoever reads this in case any related issues pop up)

New problems were just discovered: exporting a document containing a PDF as PDF with v1.3.0-rc.2 -- or just saving and loading that document -- sometimes led to a change in the scale of the PDF items in that document.

As far as I can tell, the problem was with the pageDpi setting again. For some reason, it is a persistent setting, i.e it is saved to OpenBoardUser.config.
So normally, if we load a document created on another screen / OB version / whatever, we read that document's DPI value to be able to render the contents correctly (the dpi affects the size of PDF and text items; they are scaled depending on the (document dpi)/(current dpi) ratio).
However, this document's dpi value is then saved to OpenBoardUser.config. Which means that the next time we save a document with a PDF in it, that document's dpi matches the one of the first document.
Thus, the next time this new document is loaded, its contents are scaled (because its dpi value doesn't match the current screen's dpi).

For example:
We have a document, A, created on another OB version, or another computer. The dpi is indicated as 80.
We open document A in OB 1.3. The current screen dpi is calculated to be, say, 120. So the PDF item in the document is scaled by 80/120 = 0.75 to be displayed correctly on this machine.
And UBSettings::pageDpi is set to 80.
Everything is ok until we create a new document, B, and save it. At that point, the document's dpi is set to UBSettings::pageDpi which is 80 in this case.
Next time we open B, we read its dpi value, calculate the current one, and scale the PDF items in the document. So the scale is all wrong.

So it seems this new issue arose as a result of the previous fix. But changing the pageDpi setting so that it is not saved to the config file anymore solves both the problems: documents can be transferred from 1.02 to 1.3 and from 1.3 to 1.02, exported to PDF etc without any worries (so far).

from openboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.