Skip to content

Refactor text box margins #1056

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

Merged
merged 11 commits into from
May 26, 2025
Merged

Refactor text box margins #1056

merged 11 commits into from
May 26, 2025

Conversation

ashahabov
Copy link
Member

No description provided.

@Copilot Copilot AI review requested due to automatic review settings May 25, 2025 11:50
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the text box margin functionality by extracting the margin calculations into a dedicated TextBoxMargins class and updating its usage across the code. Key changes include:

  • Creation of a new TextBoxMargins class encapsulating left, right, top, and bottom margin logic.
  • Refactoring of the TextBox class and related classes (ShapeCollection, IParagraph, and GroupedShapeCollection) to use the new margins class.
  • Minor formatting improvements in multiline expressions.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Texts/TextBoxMargins.cs Introduces a new class to encapsulate margin properties.
src/Texts/TextBox.cs Delegates margin handling to TextBoxMargins and adjusts constructor.
src/Shapes/ShapeCollection.cs, Updates creation of TextBox instances to pass the new margins instance.
src/Paragraphs/IParagraph.cs, Updates TextBox instantiation to use the refactored margins approach.
src/Groups/GroupedShapeCollection.cs Updates TextBox instantiation accordingly.
Comments suppressed due to low confidence (1)

src/Texts/TextBox.cs:381

  • [nitpick] Consider consolidating the newWidth calculation onto a single line or adjusting the indentation for the multiline expression to enhance readability.
var newWidth =

@ashahabov ashahabov changed the title Reafctor text box margins Refactor text box margins May 26, 2025
Copy link

@ashahabov ashahabov merged commit 9cd7d53 into master May 26, 2025
3 checks passed
@ashahabov ashahabov deleted the reafctor-text-box-margins branch May 26, 2025 19:59
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