Opened 2 years ago

Closed 2 years ago

Last modified 22 months ago

#17449 closed bug (fixed)

Regression: selection in Wonderbrush is not transparent anymore

Reported by: pulkomandy Owned by: pulkomandy
Priority: critical Milestone: R1/beta4
Component: Kits/Interface Kit Version: R1/beta3
Keywords: Cc:
Blocked By: Blocking: #4401
Platform: All

Description

The selection rectangle in wonderbrush is now opaque white, making wonderbrush essentially unusable. This used to work fine in previous Haiku versions but I have not needed Wonderbrush in a while

Change History (13)

comment:1 by pulkomandy, 2 years ago

Milestone: UnscheduledR1/beta4

comment:2 by waddlesplash, 2 years ago

Priority: normalcritical

comment:3 by pulkomandy, 2 years ago

Drawing is done using ConstrainClippingRegion and FillRect. As far as I can see it should only draw a stripped border around the selection, but the inside ends up being filled in white.

Possibly hrev55510 ? Can't test because building haiku on haiku 32bit is not possible currently (gcc11/gcc8 mismatches)

comment:4 by humdinger, 2 years ago

I've seen that for a very long time. In fact, I cannot remember the selected-object-rect not being white and I always thought that intentional though a poor choice...

comment:5 by waddlesplash, 2 years ago

GCC11/8 mismatches now resolved.

comment:6 by madmax, 2 years ago

Looks like a problem in the subpixel renderer or nearby. Change antialiasing to grayscale and you get just the border in selections and the navigation view.

Clipping doesn't seem to be involved: can be reproduced with just StrokeRect (or StrokeEllipse or...) called with a pattern that is not B_SOLID_HIGH nor B_SOLID_LOW. The end result seems to be the shape is filled with low color and then stroked with pattern.

comment:7 by pulkomandy, 2 years ago

There is a problem with StrokeRect when using a pattern. This change to disable the pattern results in Wonderbrush drawing just the outline (as expected):

diff --git a/WonderBrush/src/canvas_view_states/PickObjectsState.cpp b/WonderBrush/src/canvas_view_states/PickObjectsState.cpp
index 968b958..62f1d14 100644
--- a/WonderBrush/src/canvas_view_states/PickObjectsState.cpp
+++ b/WonderBrush/src/canvas_view_states/PickObjectsState.cpp
@@ -111,10 +111,10 @@ PickObjectsState::Draw(BView* into, BRect updateRect)
                into->SetHighColor(kBlack);
                into->SetLowColor(kWhite);
                BRect box = fCanvasView->ConvertFromCanvas(fBoundingBox);
-               into->StrokeRect(box, kDotted);
+               into->StrokeRect(box/*, kDotted*/);
                if (box.Width() >= 2.0 && box.Height() >= 2.0) {
                        box.InsetBy(1.0, 1.0);
-                       into->StrokeRect(box, kDotted);
+                       into->StrokeRect(box/*, kDotted*/);
                }
        }
 }

What's strange is, I tried to disable B_SUBPIXEL_PRECISE in WonderBrush and it does not make any difference. A completely different codepath is used in app_server.

So, this is a problem in code that's shared between the two cases.

Switching to B_OP_OVER or B_OP_ADD works (but looks a bit different), so it's a problem only with B_OP_COPY mode.

Last edited 2 years ago by pulkomandy (previous) (diff)

comment:9 by pulkomandy, 2 years ago

Owner: changed from nobody to pulkomandy
Status: newin-progress

in reply to:  8 comment:10 by X512, 2 years ago

Replying to pulkomandy:

Proposed fix: https://review.haiku-os.org/c/haiku/+/4836

How it worked before?

comment:11 by pulkomandy, 2 years ago

As humdinger said, this was broken for a really long time and maybe it never worked.

comment:12 by waddlesplash, 2 years ago

Resolution: fixed
Status: in-progressclosed

Fix merged in hrev55749.

comment:13 by pulkomandy, 22 months ago

Blocking: 4401 added
Note: See TracTickets for help on using tickets.