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

[WIP] SVGs: Allow for Aspect variations of scale. #45

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

patridge
Copy link
Collaborator

(Work in progress efforts toward issue #44. Not ready to merge.)

This will eventually allow for scaling SVGs in a given rendering size using the various Xamarin.Forms.Aspect enum values:

  • AspectFit: proportionally scaled and smaller by "letterboxing" (default)
  • AspectFill: proportionally scaled and larger by "cropping"
  • Fill: just stretched to fit the available space

Definitely still needed:

  • Neither SvgImage nor NControl.SvgImageView seem to respect size requests for Aspect.Fill (e.g., always the full width in the sample page, even when WidthRequest smaller)
  • SvgImage doesn't seem to handle rendering properly for Aspect.AspectFill (just flat out wrong in the sample, but maybe it's failing to recenter the rendered result on the final size)
  • SvgImage doesn't seem to handle rendering properly for Aspect.AspectFit when size is determined by layout (e.g., omitting WidthRequest)
  • ScaleThatFills extension method: failing tests: scaling down doesn't seem to work properly yet.

@patridge
Copy link
Collaborator Author

FWIW, here are some screenshots from the current sample page for reference. (I'll

SvgImageView

  • Aspect.AspectFill: pass (appears to work fine)

ncontrol svgimageview-aspectfill

  • Aspect.AspectFit: pass (appears to work fine)

ncontrol svgimageview-aspectfit

  • Aspect.Fill: fail (doesn't size to given WidthRequest)

ncontrol svgimageview-fill-failing

SvgImage

  • Aspect.AspectFill: fail (just totally not working, it may be scaling correctly but not positioning correctly)

svgimage-aspectfill-failing

  • Aspect.AspectFit: pass

svgimage-aspectfit

  • Aspect.Fill: fail (doesn't size to given WidthRequest)

svgimage-fill-failing

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.

1 participant