Gradient Transform toggle impacts lots of functionality by accident

Summary:

... (write here)

Steps to reproduce:

  • open Inkscape
  • open mesh_gradients.svg
  • Turn OFF options/transform/gradient image
  • Attempts one of these tasks:
    • Copy and paste one of the mesh gradients
    • Select one of the gradients rectangles and use Edit > Resize to Object
    • Look at the third mesh which is a bicubic mesh, it should look like 1.4 (see screenshot below)
    • Export one of the meshes by selection to an svg
    • Or if you open up the pdfoutput svg that this comes from and export page 6, the page will be blank

What happened?

  • Empty rectangles and the mesh coordinates were not updated correctly on any of these operations
  • What has gone wrong with the bicubic mesh is hard to know, the transform bugs might be old but this rendering issue has appeared just in 1.5 so should be possible to narrow down the commit that caused it.

What should have happened?

The preference in the select tool SHOULD NOT have any baring on how gradients are treated anywhere else.

Likely what is happening is that the call to resize or transform is loading the pref directly from prefs instead of having the toggle as an API argument. The deeper layers of inkscape's functionality should never be asking prefs directly as we have no idea what process the call will be involved with and this is a perfect example of why. Instead only the select tool should be using the pref and the arg should make its way from the select tools action (dragging) to the transform correction code instead of depending on the pref.

Additionally; look out of situations where the pref is being set and then unset around a call. This is a clear case of API state violation and is a make-do fix which needs to be removed too.

Sample attachments:

image

Version info



Edited by Martin Owens