Skip to content

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

@DeDiamondPro DeDiamondPro requested a review from Johni0702 May 8, 2023 15:39
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