You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I'm building a seat map for our office and I would like to dynamically add the pictures of people inside an SVGShape.
I tried getting the shape node and overriding it with an SVGDataImage, but it did not work. The shape's fill just became transparent.
for i in stride(from: 0, to: subgroup.contents.count, by: 1) {
if let id = subgroup.contents[i].id {
if id.contains("photo_") {
subgroup.contents[i] = SVGDataImage(data: Data(imageAsBase64.utf8))
}
}
}
I hope this is possible to do. Any tips? Thanks in advance!
The text was updated successfully, but these errors were encountered:
In general everything is fine, but you didn't configure your data image correctly. There are width and height which you need to set, otherwise it will be zero size by default.
Yeah, if original size of your image is different from the size you provide, that might be an issue. Unfortunately there is no way to provide content mode for now. I recommend you to make a fork and use following customization:
Add a parameter to SVGDataImage , something like:
@PublishedpublicvarisScaled:Bool= false
In SVGDataImageView check whether this parameter is set to true and apply scaling you need (like scaledToFit or scaledToFill)
I keep this issue open until we'll add support of the content mode on the SVG side.
Hi! I'm building a seat map for our office and I would like to dynamically add the pictures of people inside an SVGShape.
I tried getting the shape node and overriding it with an SVGDataImage, but it did not work. The shape's fill just became transparent.
I hope this is possible to do. Any tips? Thanks in advance!
The text was updated successfully, but these errors were encountered: