[FEATURE][needs-docs] Svg marker size: change aspect ratio#4912
[FEATURE][needs-docs] Svg marker size: change aspect ratio#4912rldhont merged 6 commits intoqgis:masterfrom
Conversation
nyalldawson
left a comment
There was a problem hiding this comment.
Cool feature! Code looks good - just one concern I've noted above.
There was a problem hiding this comment.
This change is going to break data defined marker sizes (e.g. setting a data defined size for the whole symbol). What's the motivation behind changing this?
There was a problem hiding this comment.
I thought I had to do like that.
There was a problem hiding this comment.
Can you initialize these in the header instead of here (c++11 style)
nirvn
left a comment
There was a problem hiding this comment.
@rldhont , nice feature, thanks for working this out.
There's a problem with the .ui file, whereas the minimum with of the svg marker's configuration panel has dramatically expanded.
PR looks good to me after the above .ui issue is fixed.
|
@nirvn I have updated the ui, it is the right way ? If not, which line can I update ? |
|
@nyalldawson thanks for your review. Is my update right ? |
There was a problem hiding this comment.
HEY! That's not how the doc test works... add documentation to the newly added members please :)
There was a problem hiding this comment.
But no method has been documented here...
There was a problem hiding this comment.
This reference image looks fragile due to the ~1 pixel high areas. I'd suggest:
- remove the outline from the symbol, that'll help avoid antialiasing/blending of fill/outline platform differences
- boost the minimum size here so that the smallest symbol is at least a couple of pixels thick in its center
There was a problem hiding this comment.
What's happening here? is this supposed to be reusing the existing reference image? I'd have expected it to look different given that it's only the width which is varying?
There was a problem hiding this comment.
In this case the aspect ratio has not been explicitly changed with setFixedAspectRatio or with the PreserveAspectRatio data defined property, so the Width data defined property gives the same has the Size data defined property.
I think I have to add some tests.
|
@rldhont , the width issue is still present: |
|
@nirvn I apology but I don't understand the issue ? |
|
@rldhont , try a master vs. your PR build, and notice how the minimum width (before a scrollbar appears) of the svg marker panel in your PR is much wider than on master. It's not clear to me which change in the .ui file led to that. |
|
@nirvn it is not just because this PR adds 2 new inputs and the panel it self is not scrollable ? |
|
@rldhont , problem has to do with the [x] preserve aspect ratio checkbox. The minimum width goes back to normal when I reduce the string to "P..." (test only, to dissect the issue): |
|
@nirvn, thanks ! I'll update the .ui to fix it |
|
@nirvn seems like a perfect place for your new ratio lock widget? |
|
@nyalldawson I have updated documentations and tests. |
|
Do I rebase to reorganize commits ? |
|
@nyalldawson |
36a786f to
87febcf
Compare
|
@nyalldawson and @nirvn do you have any objection to merge ? |
|
Building now for a test... |
nyalldawson
left a comment
There was a problem hiding this comment.
@rldhont I just tested and it's working very (very!) nicely. My one concern is with the UI here. What I'm wondering is whether the data defined control for preserving the aspect ratio is really necessary here? If it isn't, we should use @nirvn's new QgsRatioLockButton instead of a checkbox for the ratio lock widget. This will keep consistency between different parts of the UI, and is a lot nicer than a plain checkbox.
I also think the units combo box should be vertically centered between the width and height spin boxes. At the moment it's bottom aligned, so it doesn't look associated with the width spin box.
There was a problem hiding this comment.
Since these are protected members, they'll need doc strings (or make them private)
There was a problem hiding this comment.
Can we make these private slots? I don't like how all these widgets expose a lot of their internal workings publicly (and hence become part of stable API). If not, they need docstrings added
d7ac750 to
2ab222a
Compare
2ab222a to
352e3af
Compare
|
@rldhont the checkbox label is being chopped off now: |
|
Also, how about left aligning the "Preserve..." checkbox with "Height" and "Width" labels (capitalize first letter)? afaics, they are of the same level: subitems of the Size parameter. |
|
My view would still be to use the ratio luck button - it's much much less visual clutter then a checkbox with a lengthy label |
|
Luck=lock |
|
@nyalldawson @nirvn does the ratio lock button have documentation ? Is it already available in QGIS source tree ? |
|
QgsRatioLockButton. It's in master and should be suggested to use (API docs are there) |
352e3af to
6ffae09
Compare
|
Hi devs, |
|
@rldhont , looking much better with the radio lock button: There's an issue with the ratio lock button's pressed state, whereas the state is still pressed even though the ratio lock is disabled. Check the save as image dialog to see how it should look. Otherwise, LGTM and can't wait for it to be merged. |
|
@dmarteau can you take a look ? |
|
@nirvn I don't understand how to fix this ui point |
6ffae09 to
98f9957
Compare
|
@nirvn I have updated the way Size, Height and lock button is used. But I have an issue with the setDown button, if the button is firstly displayed as locked. Can we fix this after ? |
98f9957 to
aaaba5a
Compare
aaaba5a to
f8152c1
Compare
|
@nirvn the setDown is fixed! Can I merge ? |
|
I'll merge this PR tomorrow if I've no more comments in the meantime. |
|
@rldhont , sorry for the delay -- the PR is fine by me. Thanks, great feature addition. |




Description
Qt gives us the ability to display SVG marker with a different aspect ratio than the one defined in the SVG file.
This PR updates the way to display SVG marker and gives the ability to user to update the aspect ratio.
This PR has been funded by Ville d'Avignon
Checklist
[FEATURE]in the commit message[needs-docs]in the commit message and containt sufficient information in the commit message to be documentedscripts/prepare-commit.shscript before each commit