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

Minimal 9slice border-image support #4594

Merged
merged 9 commits into from
Feb 13, 2024
Merged

Minimal 9slice border-image support #4594

merged 9 commits into from
Feb 13, 2024

Conversation

ogoffart
Copy link
Member

@ogoffart ogoffart commented Feb 9, 2024

  • Doesn't support tiling yet, only stretching
  • Added a 9slice(...) attribute to the @image-url
  • Added API in C++ and Rust to set the edge value. (JS is missing)
  • Added rendering support in all our renderer

CC #1529

@ogoffart ogoffart requested a review from tronical February 9, 2024 17:45
(*painter)->drawPixmap(dest_rect, pixmap, source_rect);
(*painter)->restore();
}};
for fit in fit {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes me think that the vector should be called “fits” or “fitted_images”.

@@ -13,6 +13,8 @@ TestCase := Rectangle {
source-clip-x: 20;
}

out property <image> with-border: @image-url("dog.jpg", 9slice(12 13 14 15));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tests basically the code generators, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. We do not have test for renderers other than the software renderer, and that's only tested with rust.

This is important when zooming, and still allow images of 65535 pixel
width or height
The test will test that things are rendered the same with a clip. But
that gives bad error when rendering images with high ferquencies because
a small difference in the initial condition of drawing may result in
being off by a pixel.
@ogoffart
Copy link
Member Author

@tronical I'll merge this soon if you don't see an objection.

Copy link
Member

@tronical tronical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not at all - looks good to me:)

@ogoffart ogoffart merged commit b2143f6 into master Feb 13, 2024
35 checks passed
@ogoffart ogoffart deleted the olivier/image branch February 13, 2024 13:46
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