Skip to content

Add Size & SizeF structs#86

Merged
wolfgang-ironsoftware merged 9 commits intodevelopfrom
size
Jan 15, 2024
Merged

Add Size & SizeF structs#86
wolfgang-ironsoftware merged 9 commits intodevelopfrom
size

Conversation

@wolfgang-ironsoftware
Copy link
Copy Markdown
Contributor

@wolfgang-ironsoftware wolfgang-ironsoftware commented Jan 11, 2024

Title

Add Size & SizeF structs and modify Rectangle & RectangleF to have constructors that make use of these structs.

Description

Adds the Size & SizeF structs (somewhat simplified) from SixLabors.

Fixes #(issue number)

Doesn't fix any particular issue, but will be useful in IronPrint to specify sizes for printing.

Type of change

Please select the relevant option by placing an 'x' inside the brackets, like this: [x].

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 🏗️ Internal/structural update (non-breaking change that improves code quality, organization, or performance)
  • 📚 This change requires a documentation update
  • 🚀 DevOps build chain modification for release
  • 🤖 DevOps build chain modification for CI

How Has This Been Tested?

Added unit tests from SixLabors.

Checklist:

Please run through the checklist as much as possible and mark the items completed by placing an 'x' inside the brackets, like this: [x].

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have successfully run all unit tests on Windows
  • I have successfully run all unit tests on Linux

Additional Context

Add any other context, screenshots, or information about the pull request here.

Also add methods to return Size & SizeF from Rectangle & RectangleF.
Also remove some functionality from Size & SizeF for which dependencies are not available in NetStandard 2.0.
@wolfgang-ironsoftware wolfgang-ironsoftware marked this pull request as ready for review January 12, 2024 07:04
Copy link
Copy Markdown
Member

@mee-ironsoftware mee-ironsoftware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wolfgang-ironsoftware
Could you add implicit cast for another library I saw only SixLabors.ImageSharp?
We need System.Drawing, SkiaSharp, and Microsoft.Maui.Graphics.

@wolfgang-ironsoftware
Copy link
Copy Markdown
Contributor Author

@wolfgang-ironsoftware
Could you add implicit cast for another library I saw only SixLabors.ImageSharp?
We need System.Drawing, SkiaSharp, and Microsoft.Maui.Graphics.

Good idea! I'll add Monday.

@wolfgang-ironsoftware
Copy link
Copy Markdown
Contributor Author

@mee-ironsoftware Added implicit converters for other libraries you mentioned.

Also added to SizeF struct (which didn't include them).

Also added VS studio generated GetHashCode() functions as required by the IEquatable interface.

@wolfgang-ironsoftware
Copy link
Copy Markdown
Contributor Author

@mee-ironsoftware Added more operators just a second ago. So have conversion both to and from various types.

Copy link
Copy Markdown
Member

@mee-ironsoftware mee-ironsoftware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one Thanks @wolfgang-ironsoftware

@wolfgang-ironsoftware wolfgang-ironsoftware merged commit d723606 into develop Jan 15, 2024
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.

2 participants