Skip to content
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

Configurable setting to make objects display no fill color #3312

Closed
dogboydog opened this issue Mar 25, 2022 · 3 comments · Fixed by #3564
Closed

Configurable setting to make objects display no fill color #3312

dogboydog opened this issue Mar 25, 2022 · 3 comments · Fixed by #3564
Assignees
Labels
feature It's a feature, not a bug.
Milestone

Comments

@dogboydog
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When I draw objects with the rectangle/polygon tool etc. they are filled with a translucent version of the object's color. I would rather be able to disable this fill.

image
Describe the solution you'd like
For me something like View > Show Object Fill as a boolean toggle would alleviate this issue, as I don't really want to see the fill for any objects.

Describe alternatives you've considered

Toggling the fill could also be done on a per-object, per-object-layer, or per-object-type basis rather than a global toggle. Those solutions could also co-exist with the global setting, as disabling the global setting would disable all fill display, but if you have fill turned on globally, only objects that had fill enabled would have a fill color.

Another workaround mentioned was to set the opacity of the layer to less than 1 to lessen the effect of the fill.

@dogboydog dogboydog added the feature It's a feature, not a bug. label Mar 25, 2022
@eishiya
Copy link
Contributor

eishiya commented Mar 25, 2022

In my case, I usually like the fills, as I often have objects that are partially overlapped by tile layers above them, so the outlines may be obscured. However, I do have some objects for which I'd rather not have fills:

  1. I have a "camera limits" object type that usually spans most of the map, and the fill gets in the way. I currently get around it by keeping it on its own layer and hiding it when I don't need it, or lowering the opacity, but it would be nice to be able to always display just the outlines.
  2. Until Tiled gets a built-in viewport preview, I'd like to be able to use a fixed layer with a rectangle Object to show the viewport, but the fill makes this rather unpleasant. I currently use four rectangle Objects instead, forming a frame around my viewport, but this is unwieldy as I have to change multiple objects when I want to modify my viewport.

For me, a fill toggle per Object Type or per Layer would be ideal. However, I could probably make do with just a global toggle and no fills anywhere.

@bjorn bjorn self-assigned this Jun 9, 2022
@dogboydog
Copy link
Contributor Author

I wonder what a good first pass at this would be. Just the global setting, with a toggle under the View menu? Which class controls drawing the fill? Maybe i could make an attempt

@bjorn
Copy link
Member

bjorn commented Feb 3, 2023

@dogboydog Currently all objects are rendered in the MapRenderer implementations, with the fill being done in OrthogonalRenderer::drawMapObject and IsometricRenderer::drawMapObject:

        QColor brushColor = color;
        brushColor.setAlpha(50);
        const QBrush fillBrush(brushColor);

The easiest for now would be to keep the rendering there, but to pass in the fillColor from MapObjectItem::paint. There, the color could be determined the same way, but it could be left as invalid if no fill color is desired (this might render as black, so an invalid color might need to be turned into an empty QBrush explicitly, not sure).

As for where to store this setting, as per @eishiya comment I could imagine to add a bool option to the ClassPropertyType and a checkbox to the PropertyTypesEditor (see PropertyTypesEditor::addClassProperties). See MapObject::effectiveColor for how to look up the class of the object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature It's a feature, not a bug.
Projects
Status: Done
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants