[core] add stretches + content to ImagePosition
This commit is contained in:
committed by
Alexander Shalamov
parent
47dc5727ab
commit
c80baa35b3
@@ -9,14 +9,11 @@ static constexpr uint32_t padding = 1;
|
||||
|
||||
ImagePosition::ImagePosition(const mapbox::Bin& bin, const style::Image::Impl& image, uint32_t version_)
|
||||
: pixelRatio(image.pixelRatio),
|
||||
textureRect(
|
||||
bin.x + padding,
|
||||
bin.y + padding,
|
||||
bin.w - padding * 2,
|
||||
bin.h - padding * 2
|
||||
),
|
||||
version(version_) {
|
||||
}
|
||||
textureRect(bin.x + padding, bin.y + padding, bin.w - padding * 2, bin.h - padding * 2),
|
||||
version(version_),
|
||||
stretchX(image.stretchX),
|
||||
stretchY(image.stretchY),
|
||||
content(image.content) {}
|
||||
|
||||
const mapbox::Bin& _packImage(mapbox::ShelfPack& pack, const style::Image::Impl& image, ImageAtlas& resultImage, ImageType imageType) {
|
||||
const mapbox::Bin& bin = *pack.packOne(-1,
|
||||
|
||||
@@ -24,6 +24,9 @@ public:
|
||||
float pixelRatio;
|
||||
Rect<uint16_t> textureRect;
|
||||
uint32_t version;
|
||||
style::ImageStretches stretchX;
|
||||
style::ImageStretches stretchY;
|
||||
style::ImageContent content;
|
||||
|
||||
std::array<uint16_t, 2> tl() const {
|
||||
return {{
|
||||
|
||||
Reference in New Issue
Block a user