Thomas Michael Semmler on Nostr: I am a bit at the end of my rope here. In an #svg element I have another nested svg ...
I am a bit at the end of my rope here. In an #svg element I have another nested svg element. This nested svg element contains a text-element. I am attempting to calculate whether the <text> exceeds its direct parent <svg>, as its contents are changing with user input.
But the problem is that with the growing <text> element, the direct <svg> parent is also growing, regardless of viewbox or width/height or overflow attributes.
But I need it to not grow. What do I do?
#svg #javascript #webdev
Published at
2024-08-01 09:31:06Event JSON
{
"id": "118628f5fa06993857cc3b1df3750ddbc26341bb7a38795935a2b7edd6223a8d",
"pubkey": "f86500d735ea38e3a46676bcd70601111127eb346aa80670240772c8b73bebc5",
"created_at": 1722504666,
"kind": 1,
"tags": [
[
"t",
"svg"
],
[
"proxy",
"https://indieweb.social/@nachtfunke/112886065800333253",
"web"
],
[
"t",
"javascript"
],
[
"t",
"webdev"
],
[
"proxy",
"https://indieweb.social/users/nachtfunke/statuses/112886065800333253",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://indieweb.social/users/nachtfunke/statuses/112886065800333253",
"pink.momostr"
],
[
"-"
]
],
"content": "I am a bit at the end of my rope here. In an #svg element I have another nested svg element. This nested svg element contains a text-element. I am attempting to calculate whether the \u003ctext\u003e exceeds its direct parent \u003csvg\u003e, as its contents are changing with user input.\n\nBut the problem is that with the growing \u003ctext\u003e element, the direct \u003csvg\u003e parent is also growing, regardless of viewbox or width/height or overflow attributes.\n\nBut I need it to not grow. What do I do?\n\n#svg #javascript #webdev",
"sig": "9a1c74a6d94b995e6fddb4e1f302d213794ec24d5b1554d740556edc0e896e554390cabf94557f1430b3b623bede01f356b667d88fc518ed1cef419f78aac857"
}