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

Is it possible to add indentation/tab for lists? #265

Closed
douglasmatheus opened this issue Aug 25, 2023 · 3 comments
Closed

Is it possible to add indentation/tab for lists? #265

douglasmatheus opened this issue Aug 25, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@douglasmatheus
Copy link
Contributor

What problem does this feature solve?

Is it possible to add indentation/tab for lists?

image

Currently if you add a tab to a list, the text is moved to the next line, and the list marker stays at the same position as the previous line.

image

I tried to change the code, reusing the rowMargin property in Element.ts, using the same logic that the css uses for some properties: "0 0 0 0' (top, right, bottom and left). Changed the Draw.ts file method drawRow(), ListParticle.ts drawListStyle() method, and some other files with adaptations that were necessary due to rowMargin's type change, and helper functions, I even got the result I wanted.

image

But when the cursor passes over the region you notice that it has extra spacing. Maybe that's right, because it was just right-aligned, not added a tab.

canvas-editor.Mozilla.Firefox.2023-08-25.11-02-07.mp4

Do you have any tweak suggestions, or do you intend to tweak this in the future? Or do you have no plans for that either?

What does the proposed API look like?

Make it possible to add indentation to lists.

@douglasmatheus
Copy link
Contributor Author

If you can help by guiding how to proceed, I can better understand the structure of the project, and help with changes to new features by PR.

@Hufe921 Hufe921 added the enhancement New feature or request label Aug 26, 2023
@Imran17507
Copy link

@douglasmatheus Just out of curiosity, how long did it take you to study the codebase and how long did it take you to implement the sublist / nested list / tab for lists?

@douglasmatheus
Copy link
Contributor Author

Hi @Imran17507 , the implementation didn't take long once I found the right places. It took some time to understand the logic, but nothing too complicated as it is well separated and organized.

However, the processing is relatively complex, but I've been following the implementations for a while, with each new feat I look at the changes to familiarize myself with the code, so it wasn't that complicated.

@Hufe921 Hufe921 closed this as completed Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants