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

Prevent TouchCursor from being cleared while it is still needed. #1477

Merged
merged 14 commits into from
Jun 16, 2021

Conversation

a-gagnon
Copy link
Contributor

@a-gagnon a-gagnon commented May 21, 2021

Fix an issue with mobile devices where the TouchCursor would disappear for no apparent reason. It it due to the order in which we call enableSnap/enableLocate. Previously, only enableSnap would determine the presence of the TouchCursor. Now, both enableSnap and enableLocate do (see #1038).

The following sequence will lead to the problem:
ToolSettings.enableVirtualCursorForLocate = true;

// Tool starts. isElementSelected = false
accuSnap.enableLocate(!isElementSelected); // on
accuSnap.enableSnap(isElementSelected); // off

// User is prompted to tap to invoke the TouchCursor
user taps and invokes TouchCursor
user taps and selects an element

accuSnap.enableLocate(!isElementSelected); // off. Clears the TouchCursor.
accuSnap.enableSnap(isElementSelected); // on.
// User is prompted to tap to invoke the TouchCursor

Note: tools that directly call enableSnap/enableLocate might still experience this problem. Fixing this problem entirely would require AccuSnap to wait some time (1 frame?) before effectively clearing the TouchCursor.

Fix an issue with mobile devices where the TouchCursor would disappear for no apparent reason. It it due to the order in which we call enableSnap/enableLocate. Previously, only enableSnap would determine the presence of the TouchCursor. Now, both enableSnap and enableLocate do (see iTwin#1038).

The following sequence will lead to the problem:
  ToolSettings.enableVirtualCursorForLocate = true;
  accuSnap.enableLocate(true);
  accuSnap.enableSnap(false);

  // some touch operation to turn the TouchCursor on (eg. onTouchTap)
  // maybe pick an element or something within the tool
  accuSnap.enableLocate(false); // this will clear the TouchCursor
  accuSnap.enableSnap(true); // we still want the TouchCursor, but user will have to perform another touch operation to put it back on

Note: tools that directly call enableSnap/enableLocate might still experience this problem. Fixing this problem entirely would require AccuSnap to wait some time (1 frame?) before effectively clearing the TouchCursor.
@a-gagnon a-gagnon requested review from bbastings, kabentley and a team as code owners May 21, 2021 20:41
Copy link
Member

@pmconne pmconne left a comment

Choose a reason for hiding this comment

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

I defer to @bbastings.

@bbastings bbastings enabled auto-merge (squash) May 22, 2021 13:33
@a-gagnon a-gagnon closed this May 25, 2021
auto-merge was automatically disabled May 25, 2021 13:00

Pull request was closed

@a-gagnon a-gagnon reopened this May 25, 2021
@a-gagnon
Copy link
Contributor Author

a-gagnon commented Jun 8, 2021

@kabentley Could you please have a look? I need to provide updates once in a while for a fix that depends on this one.

@bbastings bbastings enabled auto-merge (squash) June 10, 2021 12:40
@calebmshafer
Copy link
Member

@a-gagnon can you please run rush change? Looks like the CI job is failing due to that.

auto-merge was automatically disabled June 14, 2021 15:51

Head branch was pushed to by a user without write access

@a-gagnon
Copy link
Contributor Author

@calebmshafer Done, but it looks like every reviewer from every repo needs to accept changes because of the rush change output...

@pmconne
Copy link
Member

pmconne commented Jun 14, 2021

@calebmshafer Done, but it looks like every reviewer from every repo needs to accept changes because of the rush change output...

@calebmshafer is that because he's running it on a fork?

@calebmshafer
Copy link
Member

calebmshafer commented Jun 14, 2021

@calebmshafer Done, but it looks like every reviewer from every repo needs to accept changes because of the rush change output...

@calebmshafer is that because he's running it on a fork?

@pmconne yes it looks like rush change ran against the master branch of @a-gagnon's fork rather than the main one. It should automatically find the imodeljs:master though... Let me try it and see.

Edit: Validated that this was the issue and opened PR #1637 to help avoid anyone else from hitting this. Going to merge the PR as is because the extra changelogs really aren't hurting anything...

@calebmshafer calebmshafer merged commit b6d2763 into iTwin:master Jun 16, 2021
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.

None yet

5 participants