mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-30 09:54:02 +08:00
Fix not finishing the sRGB line on hue around 246
Bug: 1408777 Change-Id: I3147c576e70fa9ef7276c350a72b688eecb9f714 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4194331 Reviewed-by: Philip Pfaffe <pfaffe@chromium.org> Commit-Queue: Philip Pfaffe <pfaffe@chromium.org> Auto-Submit: Ergün Erdoğmuş <ergunsh@chromium.org> Commit-Queue: Ergün Erdoğmuş <ergunsh@chromium.org>
This commit is contained in:
committed by
Devtools-frontend LUCI CQ
parent
77c04d83f0
commit
ee88a2c74c
@@ -63,6 +63,18 @@ export class SrgbOverlay extends HTMLElement {
|
||||
}
|
||||
}
|
||||
|
||||
if (linePoints.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const lastPoint = linePoints[linePoints.length - 1];
|
||||
if (lastPoint.x < width) {
|
||||
linePoints.push({
|
||||
y: lastPoint.y,
|
||||
x: width,
|
||||
});
|
||||
}
|
||||
|
||||
return linePoints;
|
||||
}
|
||||
|
||||
@@ -70,7 +82,7 @@ export class SrgbOverlay extends HTMLElement {
|
||||
let min = Infinity;
|
||||
let closestPoint = null;
|
||||
for (const point of points) {
|
||||
if (Math.abs(atHeight - point.y) < min) {
|
||||
if (Math.abs(atHeight - point.y) <= min) {
|
||||
min = Math.abs(atHeight - point.y);
|
||||
closestPoint = point;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user