"help wanted" DrawText function return 0 for x,y, width and height #374
Replies: 15 comments 1 reply
-
Is this code valid?
It is very strange code. Dividing to the window width/height will give you values ~0 always. |
Beta Was this translation helpful? Give feedback.
-
@tordex Thanks for the quick response, You were right. That was part of the issue.
I'm wondering why it is not centered vertically. The DrawText functions return x=400, y=14. Is it related to some unsupported CSS style? |
Beta Was this translation helpful? Give feedback.
-
litebrowser shows the same, so yes, there are something unsupported :( |
Beta Was this translation helpful? Give feedback.
-
@tordex Thanks for the response! This is by far the best HTML renderer out there so no complaints here :) |
Beta Was this translation helpful? Give feedback.
-
Flexbox is working. Yay! |
Beta Was this translation helpful? Give feedback.
-
Can someone tell me why DrawText returns the same y for both texts? Also, is the text height zero for both of them? Where can I set this text height variable? |
Beta Was this translation helpful? Give feedback.
-
implement the |
Beta Was this translation helpful? Give feedback.
-
@tordex Thanks alot! It's working now! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Currently litehtml has a limited ways to manipulate html. You can use css |
Beta Was this translation helpful? Give feedback.
-
@tordex Is the set_attr currently working ? I've been trying to manipulate the HTML without re-parsing everything. I can access and manipulate the classes, but it is unaffected when I call the draw function. Is there some dirty function I can call to signal the system? |
Beta Was this translation helpful? Give feedback.
-
I didn't test changing attributes directly, but this can work.
After changing CSS attributes call render before draw. |
Beta Was this translation helpful? Give feedback.
-
@tordex Thanks for the quick response! I have called the render before drawing after I modify the style, but it is still not working. It's very strange. I dig deeper into the source code to understand how it works. |
Beta Was this translation helpful? Give feedback.
-
Hey @tordex, Thanks again for this excellent library. I'm unsure if this is a bug in the library. Could you please let me know what's wrong with this code? I am trying to highlight the selected button, but it does not work. When I added the "selected" class directly to the HTML, it worked, but it did not work if I modified the class attributes after creating the HTML text.
|
Beta Was this translation helpful? Give feedback.
-
Hey again @tordex , I managed to make it work, although it required some minor change in the library:
It would be great to have a reloadStyle function that calls these functions automatically. I found something similar in adding child functionality. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! Thanks a lot for your excellent library.
I've been trying to integrate this library into my Vulkan library, but I'm facing a problem that requires your assistance.
And this is my code:
Could you please let me know the issue with the DrawText function always returning zero(x, y, width, height) for me?
This is the result I'm getting:

And this is what I'm expecting:

Beta Was this translation helpful? Give feedback.
All reactions