-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Textbox selection
is still visible outside of the clipPath
#10274
Comments
Thanks for opening the issue. Because when we bake a behavior in the library we need to make sure it is at least supported by common sense |
Thanks, @asturur , I appreciate your reply. That demo essentially replicates what in HTML would be a div with Likewise, a |
From the other perspective, what is the justification for "a clipPath defines the area in which things are visible, but sometimes things (e.g. selection, cursor) are actually still visible outside the clipped area"? |
I wasn't debating the logic itself of clipping. I m trying to understand how important it is to get fixed. |
Thank you, Andreas. 🙏 For me, it's critical to what I'm building. I'd be
happy to contribute to a fix however I'd need ample guidance.
…On Fri, Nov 15, 2024, 10:30 AM Andrea Bogazzi ***@***.***> wrote:
I wasn't debating the logic itself of clipping.
I was just thinking who wants to edit text in a clipped container.
I understand from a pure concept of the api it make sense that what is
clipped is not visible.
I m trying to understand how important it is to get fixed.
—
Reply to this email directly, view it on GitHub
<#10274 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAQXCXBVL6XFRICF7ZRETL2AYVRXAVCNFSM6AAAAABRZZMJE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZZGUZDCMJTHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
In version 6.5.2, the rendered selection for selected text (the blue background behind selected text) in an IText or Texbox instance is no longer rendered at all if the IText/Textbox is nested within a group that has a clipPath applied. Demo using 6.5.2 (no visible selection for selected text)" Demo (same code) using 6.5.1 (visible selection for selected text): |
Thank you for pinpoitning the version that broke. https://github.com/fabricjs/fabric.js/releases/tag/v652 I don't see any possible culprit in the list of changes, i would have argued that 6.5.0 was a good candidate to break this. I'll check the diffs asap, maybe some of my TS-cleaning-only changes i actually broke something |
Weirdly is the render loop that breaks it. |
That is very unexpected |
i think the only solution for the short term is for you to have this loop here: function renderLoop() {
canvas.renderAll();
const active = canvas.getActiveObject();
if (active && active.renderCursorOrSelection) {
active.renderCursorOrSelection();
}
fabric.util.requestAnimFrame(() => {
renderLoop();
});
} In order to fix this i have too coordinate a change in the function renderTop and make the text functions able to call that. Imho the performance improvement of 6.5.2 is worth the upgrade for the hassle of adding explicits |
Textbox
selection
is still visible outside of theclipPath
:Originally posted by @drinkspiller in #10269 (comment)
The text was updated successfully, but these errors were encountered: