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

Fixed pos image #165

Merged
merged 6 commits into from
Oct 12, 2023
Merged

Fixed pos image #165

merged 6 commits into from
Oct 12, 2023

Conversation

boatwrong
Copy link

This PR adds a feature

This is one by exposing positioning properties of the Image

        /// <summary>
        /// Get or set the Image's horizontal position.
        /// </summary>
        public HorizontalPosition horizontalPosition {
            get {
                if (_Image.Inline == null) {
                    var anchor = _Image.Anchor;
                    var hPosition = anchor.HorizontalPosition;
                    return hPosition;
                } else {
                    throw new InvalidOperationException("Inline images do not have HorizontalPosition property.");
                }
            }
            set {
                if (_Image.Inline == null) {
                    var anchor = _Image.Anchor;
                    anchor.HorizontalPosition = value;
                } else {
                    throw new InvalidOperationException("Inline images do not have HorizontalPosition property.");
                }
            }
        }

        /// <summary>
        /// Get or set the Image's vertical position.
        /// </summary>
        public VerticalPosition verticalPosition {
            get {
                if (_Image.Inline == null) {
                    var anchor = _Image.Anchor;
                    var vPosition = anchor.VerticalPosition;
                    return vPosition;
                } else {
                    throw new InvalidOperationException("Inline images do not have VerticalPosition property.");
                }
            }
            set {
                if (_Image.Inline == null) {
                    var anchor = _Image.Anchor;
                    anchor.VerticalPosition = value;
                } else {
                    throw new InvalidOperationException("Inline images do not have VerticalPosition property.");
                }
            }
        }

Includes an example and test case for the newly exposed properties.

@PrzemyslawKlys PrzemyslawKlys merged commit 7dac5a3 into EvotecIT:master Oct 12, 2023
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