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

types(dia.Element): fix size() signature #2734

Merged
merged 2 commits into from
Aug 14, 2024

Conversation

zbynekstara
Copy link
Contributor

@zbynekstara zbynekstara commented Aug 9, 2024

Description

According to the source code, dia.Element.size() has the following three signatures:

  • getter (no arguments) = return this.get('size')
  • setter (two arguments, first argument is an object) = read width and height from first argument (if not present, get the missing value from the current size attribute), pass width, height, and second argument to this.resize as width, height, opt
  • setter (three arguments) = return this.resize(width, height, opt)

Documentation

size()

element.size(): Size;

Return the current size of the element as an object with width and height.

element.size(
    size: Partial<Size>,
    opt?: Element.ResizeOptions
): this;

Change the size of the element with an object that specifies the new width and height. If a value is not provided for a property, the old value is kept.

You may specify resize options in the second parameter. See the resize() method for more information.

element.size(
    width: number,
    height: number,
    opt?: Element.ResizeOptions
): this;

Change the size of the element to the provided width and height.

You may specify resize options in the third parameter. See the resize() method for more information.

@kumilingus kumilingus closed this Aug 12, 2024
@kumilingus kumilingus reopened this Aug 12, 2024
@kumilingus kumilingus merged commit 9e22400 into clientIO:master Aug 14, 2024
3 of 4 checks passed
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