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

Markdown: fix images not moving text after it down appropriately #111

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DeDiamondPro
Copy link
Contributor

@DeDiamondPro DeDiamondPro commented May 2, 2023

  • Remove scaleModifier from currY calculation because components who use it already pass it their height to maxLineHeight with it applied (see ParagraphDrawable line 110 and TextDrawable line 126)
  • Remove prevY since it makes the paragraph report a size one line smaller then it should be
  • Use with drawable reports for widthRemaining and currX so it is accurate for everything and not only text
  • Add size of last line properly or if there is none remove the extra space

Code used for example:

        MarkdownComponent(
            "![](https://picsum.photos/800/300)" +
                    "\n# Markdown Test"
        ).constrain {
            x = CenterConstraint()
            y = 0.pixels()
            width = 800.pixels()
            height = 100.percent()
        } childOf window

Before:
image
After:
image

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