Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
a1e0ef48
Commit
a1e0ef48
authored
11 years ago
by
Keisuke Kuroyanagi
Browse files
Options
Downloads
Patches
Plain Diff
Fix: point to line segment distance can be NaN.
Change-Id: I7db6bfea925a0eda82bfb1f7b5e1110b193dabdb
parent
33392248
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
native/jni/src/suggest/core/layout/proximity_info_utils.h
+4
-0
4 additions, 0 deletions
native/jni/src/suggest/core/layout/proximity_info_utils.h
with
4 additions
and
0 deletions
native/jni/src/suggest/core/layout/proximity_info_utils.h
+
4
−
0
View file @
a1e0ef48
...
@@ -100,6 +100,10 @@ class ProximityInfoUtils {
...
@@ -100,6 +100,10 @@ class ProximityInfoUtils {
const
float
dotProduct
=
ray1x
*
ray2x
+
ray1y
*
ray2y
;
const
float
dotProduct
=
ray1x
*
ray2x
+
ray1y
*
ray2y
;
const
float
lineLengthSqr
=
GeometryUtils
::
SQUARE_FLOAT
(
ray2x
)
const
float
lineLengthSqr
=
GeometryUtils
::
SQUARE_FLOAT
(
ray2x
)
+
GeometryUtils
::
SQUARE_FLOAT
(
ray2y
);
+
GeometryUtils
::
SQUARE_FLOAT
(
ray2y
);
if
(
lineLengthSqr
<=
0.0
f
)
{
// Return point to the point distance.
return
getSquaredDistanceFloat
(
x
,
y
,
x1
,
y1
);
}
const
float
projectionLengthSqr
=
dotProduct
/
lineLengthSqr
;
const
float
projectionLengthSqr
=
dotProduct
/
lineLengthSqr
;
float
projectionX
;
float
projectionX
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment