-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(FillStyle): Add controls for fill color and opacity for shapes #693
feat(FillStyle): Add controls for fill color and opacity for shapes #693
Conversation
I made a live link to help expedite testing:
I found a few small things:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
featurestyleaction.js
needs to be updated to include fill color and opacity for export/import of feature actions
056714f
to
325ad9b
Compare
Testing feedback:
|
The opacity slider behavior should be as follows:
This should now behave the same for both commands and Feature Edit. When undoing a fill opacity change, it should now properly reset to the previous value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to see the large volume of code duplication in this PR reduced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layers:
- Layers that were loaded in the application prior to this change have a default fill opacity of 1 instead of 0. The layer should probably correct this in
restore
ifos.style.StyleField.FILL_COLOR
is not defined on the config. - Point geometries are using the fill color. That should only change
config.fill
, notconfig.image.fill
. Points should be using the "Color" UI value. - If I undo the color, fill color, or fill opacity commands, the fill opacity is always set to 1.
- The color Reset buttons (color and fill color) throw an error. More details in the code review.
Places:
- The fill color command resets fill opacity to 1 on undo.
- When the fill color matches the base color, changing the base color puts two commands on the stack. It should add a single command (likely multiple commands wrapped in a sequence command), and undo/redo should work for that command.
- The fill color Reset button throws an error. More details in the code review.
Feature Actions:
- Point geometries are using the fill color. That should only change
config.fill
, notconfig.image.fill
. Points should be using the "Color" UI value.
BREAKING CHANGE: Adds required argument to os.ui.file.kml.AbstractKMLExporter#createStyle
Fix an issue when undoing fill opacity. Fix when sliding stroke opacity when using Feature Edit dialog.
BREAKING CHANGE: This changes the behavior of `os.style.getConfigColor` when using a field hint. - If `config.<hint> === null`, return `null`. This allows disabling stroke/fill. - If `config.<hint>.color` is defined, return the value. - Return `undefined` otherwise, indicating the field/color could not be found.
I cleaned up remaining issues I've come across in testing, as well as a few bugs from master:
|
Feedback resolved.
I deployed this to Surge at http://os-fill-controls.surge.sh/, updated in the issue description. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When creating or editing a Place - the border dash options drop down doesn't show the initial selection
In the layers window, when the opacity and fill opacity sliders get set to the same value, changing the opacity slider also causes the fill opacity to change. This is not consistent with the behavior when creating/editing a Place
This is broken on master, unrelated.
Ah thanks, missed that one when I was removing the opacity/fill opacity linkage. Fixed/deployed. |
Follow-on issues here: #737 |
Changing layer opacity at the config level has significant performance implications, in that it creates new style objects for each opacity value. It also prevents the layer opacity control from affecting KML layers because the layer config is ignored.
Fill opacity is serialized in the fill color case.
@justin-bits I believe all of those are resolved, though I didn't see the second bullet prior to my latest changes. This PR was making a fundamental change to how the layer-level opacity slider was working. Instead of using OL's
To resolve these issues, the original layer opacity behavior was restored. This does mean the layer opacity will be multiplied by fill opacity, so if they're both at 50% the fill will be rendered at 25%. This seemed to be a reasonable compromise to avoid the above problems. |
Looks good |
Add controls for fill color and opacity for shapes, vector layers, and feature actions.
re #531
Testing link: http://os-fill-controls.surge.sh/