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

Change color Offset from double to struct #89

Closed
mgierlasinski opened this issue Jun 4, 2020 · 0 comments · Fixed by #91
Closed

Change color Offset from double to struct #89

mgierlasinski opened this issue Jun 4, 2020 · 0 comments · Fixed by #91
Assignees
Labels
good first issue Good for newcomers 🛠️ enhancement New feature or request
Milestone

Comments

@mgierlasinski
Copy link
Owner

Change Offset property from double to ColorOffset structure:

public struct ColorOffset
{
   public OffsetUnit { get; set; }
   public double Value { get; set; }
}
public enum OffsetUnit 
{
   Proportion, Pixels, Percent
}

With double type there is no way to distinguish between percent and pixels when CSS is parsed:
1px => 1 (valid proportion and pixel value)

Provide Offset type converter for XAML:

  • Offset="0.25" => no changes
  • Offset="25%" => calculate to 0.25
  • Offset="34px" => calculate based on canvas size
@mgierlasinski mgierlasinski added the 🛠️ enhancement New feature or request label Jun 4, 2020
@mgierlasinski mgierlasinski added this to the vNext milestone Jun 4, 2020
@mgierlasinski mgierlasinski self-assigned this Jun 4, 2020
@mgierlasinski mgierlasinski modified the milestones: vNext, v1.1.1 Jun 4, 2020
@bbenetskyy bbenetskyy added the good first issue Good for newcomers label Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers 🛠️ enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants