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

add features for border-style dashed, dotted, double. #2531

Merged
merged 1 commit into from
Jul 4, 2021

Conversation

flyskyko
Copy link
Contributor

@flyskyko flyskyko commented May 17, 2021

Summary

This PR fixes/implements the following bugs/features

  • Fixes incorrect rounded border box
  • Dashed border style
  • Dotted border style
  • Double border style
  • Fixes incorrect rounded border box
    • Change parameter value of XxxXxxPaddingBox correctly in bound-curves.ts
  • Dashed border style
    • Calculate a dash length and space length (I referred to the Chromium source code)
    • Draw dash line on border outer path with double thickness and clip
    • If corner is rounded draw additional line to fill the gaps between the sides.
  • Dotted border style
    • Added XxxXxxBorderStroke in bound-curves.ts
    • Calculate a dash length and space length (I referred to the Chromium source code)
    • Draw dash line with round line cap on border center path
  • Double border style
    • Added XxxXxxBorderDoubleOuterBox and XxxXxxBorderDoubleInnerBox
    • Fill outer box and inner box

Test plan (required)

Dashed (browser, tests/reftests/border/dashed.html)
image

Dashed (html2canvas, tests/reftests/border/dashed.html)
image

Dotted (browser, tests/reftests/border/dotted.html)
image

Dotted (html2canvas, tests/reftests/border/dotted.html)
image

Double (browser, tests/reftests/border/double.html)
image

Double (html2canvas, tests/reftests/border/double.html)
image

Radius (browser, tests/reftests/border/radius.html)
image

Radius (html2canvas this branch, tests/reftests/border/radius.html)
image

Radius (html2canvas 1.0.0-rc.7, tests/reftests/border/radius.html)
image

Closing issues

Fixes #210, Fixes #366, Fixes #1354

@margox
Copy link

margox commented Jun 22, 2021

@flyskyko Good job!
and will this feature be released in the next version? @mephju

@mephju
Copy link

mephju commented Jun 22, 2021

oh i don't run this project. i just approved it. honestly tho this project seems to be abandoned.

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.

it doesn't support dashed border style border-style property does not work border:dashed renders as solid
4 participants