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.Paper): allow disabling allowNewOrigin option #2530

Conversation

kumilingus
Copy link
Contributor

Description

It's currently not possible to override the allowNewOrigin to its default. This PR makes it possible to pass false for the paper origin to remain at 0,0 in TypeScript.

Note that this has always been possible in JavaScript, and this PR just changes the types and updates the documentation to make it clear.

// before
paper.getFitToContentArea({ allowNewOrigin: 'negative' | 'positive' | 'any'  })

// after
paper.getFitToContentArea({ allowNewOrigin: false | 'negative' | 'positive' | 'any'  })

The problem was evident in the paper scroller.

const scroller = new ui.PaperScroller({
   /* ... */
   contentOptions: {
      allowNewOrigin: false // the paper scroller default for `allowNewOrigin` is `positive`
   }
})

@kumilingus kumilingus marked this pull request as ready for review February 10, 2024 04:35
@zbynekstara zbynekstara merged commit d0702f9 into clientIO:master Feb 20, 2024
3 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