-
Notifications
You must be signed in to change notification settings - Fork 215
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
fix: add condition to handle_imperfect_touch #1346
base: develop
Are you sure you want to change the base?
Conversation
@@ -66,12 +73,6 @@ struct side_calculator | |||
inline int pk_wrt_q2() const { return m_side_strategy.apply(get_qj(), get_qk(), get_pk()); } | |||
inline int qk_wrt_p2() const { return m_side_strategy.apply(get_pj(), get_pk(), get_qk()); } | |||
|
|||
// Necessary when rescaling turns off: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved above to order i, j, k
@@ -674,6 +682,7 @@ struct touch : public base_turn_handler | |||
{ | |||
if (side_qk_p1 == 0 && side_pk_q1 == 0 | |||
&& has_pk && has_qk | |||
&& opposite(side.pi_wrt_q1(), side.qk_wrt_p2()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the fix
6688aa8
to
cd4deda
Compare
static std::string issue_1345_a[2] = | ||
{ | ||
// Needs check for opposite in handle_imperfect_touch | ||
R""""( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vissarion this is (AFAIK) the first case written in this new multi-line format.
It doesn't have all those quotes and reflects the reported case.
Like it?
Fixes #1345
Difference was wrong for both cases, caused by nearly opposite segments. The condition causing this had to be finetuned with an extra check.
Fixed behaviour:
a (
p
=big polygon containing all,q
=small rectangle at top which subtly overlapsp
)Difference a-b (in image, this should be a rectangle, correct)
Difference b-a -> 0 (correct)
b (
p
= u-shape,q
= the lower bar of it, subtly overlappingp
)Difference
a-b
(in image, this should be the two vertical bars of the u, correct)Difference
b-a
-> 0 (correct)