viewBox and center changed

Asked by Wolfgang Hammel

Hi,

I recently noticed, that in the Windows nightly builds somewhere between the releases r13487 and r14355 the viewBox-attribute set in the document was changed.

In an A4-document (210mm x 297mm), centered on the screen by pressing "5" it behaves like follows:
r13487, document units = "mm"
  viewBox="0 0 210 297.00001"
  inkscape:cx="372.04723"
  inkscape:cy="526.18109"
  inkscape:document-units="mm"

r13487, document units = "px"
  viewBox="0 0 744.09447 1052.3622"
  inkscape:cx="372.04723"
  inkscape:cy="526.18109"
  inkscape:document-units="px"

r14355, document units = "mm"
  viewBox="0 0 210 297"
  inkscape:cx="396.85039"
  inkscape:cy="561.25984"
  inkscape:document-units="mm"

r14355, document units = "px"
  viewBox="0 0 210 297"
  inkscape:cx="396.85039"
  inkscape:cy="561.25984"
  inkscape:document-units="px"

The center position in inkscape:cx and inkscape:cy was supposed to be in px-coordinates no matter what document units are set. However in r14355 and later the values have changed somehow and are not inkscape-px anymore.

OS is Windows 7 Professional 64 bit, same behaviour also on Windows Vista

Question information

Language:
English Edit question
Status:
Expired
For:
Inkscape Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was originally filed as bug #1516368.

Revision history for this message
Wolfgang Hammel (wolfgang-hammel) said :
#1

I have an Inkscape extension that creates new objects and tries to place them at the center of the current view.
In order to calculate the correct transformation for this, the information from inkscape:cx and inkscape:cy is used.
Up to now it was possible to assume that this information is in 90 dpi.
But if that has changed, the extension has to know on what version of Inkscape it is currently running on.

I will review the information in #1389723 and convert this one to a question.

Tnx.

Revision history for this message
su_v (suv-lp) said :
#2

On 2015-11-15 14:40 (+0100), ~suv wrote:
> On 2015-11-15 14:24 (+0100), Wolfgang Hammel wrote:
>> I have an Inkscape extension that creates new objects and tries to
>> place them at the center of the current view.
>
> The changes proposed in bug #1508400 and bug #1503882 might be related
> (neither has been reviewed yet, and I personally haven't looked into
> other use cases apart from the Inkscape's own 'Render' extensions which
> create objects in the document's view center - the two reports and the
> patches I was working on happened independently so far).

A quick test with the 'Render > Gear > Gear' extension (which also inserts the object at the current view's center), using a document created with Inkscape 0.91 (90dpi) based on the default template, and opened in current trunk (r14472) shows that the changes proposed in bug #1508400 seem to be sufficient to take the different document scale into account (with the patch in place, the gear is inserted correctly at the current view's center, otherwise it is slightly offset).

Revision history for this message
Launchpad Janitor (janitor) said :
#3

This question was expired because it remained in the 'Open' state without activity for the last 15 days.