Skip to content

Aspect ratio respecting presenter #4103

Closed
@michael-hawker

Description

@michael-hawker

Discussed in #4060

Originally posted by chingucoding June 2, 2021
As a developer, sometimes the need arises to scale content based on the aspect ratio. E.g. when creating using UI Elements to convey diagrams (e.g. using Paths etc). Right now however, this is hardly possible. Developers could use ViewBox, however a ViewBox scales everything up meaning a border of 2px can become a border of 20px if the initial element was small and is getting scaled up to much. This is where the new [insert cool control name] control comes in that allows us to restrict an control to a specific aspect ratio but also allows it to scale up/scale down based on the available space.

Possible AC:

  • If a control is placed in it, and it takes up the entire space, the aspect ratio will stay constant
  • Developers can specify the aspect ratio
  • The control take all the space available that would still result in respecting the aspect ratio
  • Setting MinWidth, MinHeight, MaxWidth, and MaxHeight all is being respected by the control
  • HorizontalAlignment and VerticalAlignment is being respected correctly
  • Changes in size for the control result in it's content being updated
  • An aspect ratio of 1:4 is different than an aspect ratio of 4:1 (first one is wide, second one is narrow)

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions