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

(WIP) feat!: rework DrawObjects #29

Draft
wants to merge 46 commits into
base: main
Choose a base branch
from
Draft

(WIP) feat!: rework DrawObjects #29

wants to merge 46 commits into from

Conversation

Im-Beast
Copy link
Owner

@Im-Beast Im-Beast commented Aug 4, 2023

This PR is meant to replace DrawObjects with Painters.

Main changes that are planned include:

  • Canvas will now implement Drawable interface, which has draw() method. This will allow for easier interception and/or manipulation of drawing on canvas.
  • BoxObject and TextObject will now use BoxPainter and TextPainter names.
    • This should remove a lot of confussion of what they exactly are and what they do
  • TextObject will use normal rectangle, and will allow for multiline text drawing, simplifying component creation that use text by a lot.
  • new ShapePainter class that will allow for drawing on canvas using 2d array, allowing things like Frame to use only one component instead of combining multiple – again simplyfying component creation
  • Potential performance improvements as painters will try to calculate neccessary data using signals instead of doing it each time rerender() gets called

@Im-Beast Im-Beast changed the title (WIP) feat: rework DrawObjects (WIP) feat!: rework DrawObjects Aug 4, 2023
@Im-Beast Im-Beast force-pushed the draw_object_rework branch from 0544aa3 to 38c259e Compare August 14, 2023 10:59
…ainter

Following changes were made:
 - `TextPainter` now automatically detects whether someone explicitely set `width` **and** `height` in options, and if so – sets `overwriteRectangle` to `true` (if unspecified in options!)
 - This removes `SignalOfObject` type, as it was malfunctioning and made working with signal types a headache.
 - `Label` now auto detects `multiCodePointSupport` and `overwriteRectangle` the same way `TextPainter` does
 - `Button` now uses `TextPainter` and doesn't use Label as `subComponent`
 - Added `unsignalify()` function to `utils/signals.ts`
 - Added `doesOverwriteRectangle()` function to `utils/painter.ts`
@agorushkin
Copy link

Is this completely dead?

@Im-Beast
Copy link
Owner Author

Is this completely dead?

This PR, probably.

Tui in itself? Not really
There is just a lot of things I want to do at this moment.
I was working on completely rewritten Tui version, but there is a lot of things I want to take in consideration about its design, mostly to completely fix issues I have with current implementation.
There is also a lot of unknowns regarding Deno and JSX support on JSR.

@agorushkin
Copy link

Alright, I understand.

I really like the concept of this library and its relative novelty, especially in the Deno space. I haven't seen many good alternatives in the Node ecosystem either. However, I've encountered some bugs with rendering and other areas. These might not warrant issues right now, considering a rewrite is planned.

If you develop a more stable design for the project and have a clear vision for its overall feel, I'd be willing to help with some implementations. While I don't have extensive experience in this terminal rendering aspect, I'd be eager to contribute and learn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants