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

Align GC behavior on init calls on all platforms #1736

Open
karolszafranski opened this issue Sep 13, 2018 · 5 comments
Open

Align GC behavior on init calls on all platforms #1736

karolszafranski opened this issue Sep 13, 2018 · 5 comments
Assignees
Labels

Comments

@karolszafranski
Copy link
Member

Problem description

You can call init on GC instance multiple times. We have to align what should happen if you call it for the second time with different dimensions or without any parameters at all.

Currently, iOS uses 0 for the dimension which is undefined and all drawings are removed on each init call.

Expected behavior

We expect that all platforms are consistent :-)

Environment

  • Tabris.js version: 3.0.0-beta
  • Device: any
  • OS: any
@mpost
Copy link
Member

mpost commented Sep 17, 2018

As you pointed out calling getContext and thereby the internal init() call again should reset the context with the newly given dimensions. The Android client does so and reinitializes the context.

@karolszafranski
Copy link
Member Author

What about the case when init is called without width and height parameters?

@mpost
Copy link
Member

mpost commented Sep 17, 2018

Than it should be assumed that the canvas has 0 width and height but the context is reinitialized as expected.

@karolszafranski
Copy link
Member Author

This means that we have to update the test in run-all.js

@tbuschto

@tbuschto
Copy link
Member

Actually calling getContext without parameters may cause errors and even crashes on both platforms. This should simply not be allowed. Calling getImageData with values that are out of bounds also behaves inconsistently.

@mpost mpost modified the milestones: 3.0, 3.1 May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants