⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 160143 in webkit


Ignore:
Timestamp:
Dec 4, 2013, 4:17:54 PM (13 years ago)
Author:
Antoine Quint
Message:

Web Inspector: color picker doesn't work with "blue"
https://bugs.webkit.org/show_bug.cgi?id=125262

Reviewed by Joseph Pecoraro.

Under certain circumstances rounding issues would have us compare
two equal numbers that differ by 0.00000001 and sometime trip this
if statement and yield a null color. We now add a little fudge to
the test and also return a clear color rather than null to match what
we do in the getters for "tintedColor" and "rawColor".

  • UserInterface/ColorWheel.js:

(WebInspector.ColorWheel.prototype._colorAtPointWithBrightness):

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r160142 r160143  
     12013-12-04  Antoine Quint  <graouts@apple.com>
     2
     3        Web Inspector: color picker doesn't work with "blue"
     4        https://bugs.webkit.org/show_bug.cgi?id=125262
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        Under certain circumstances rounding issues would have us compare
     9        two equal numbers that differ by 0.00000001 and sometime trip this
     10        if statement and yield a null color. We now add a little fudge to
     11        the test and also return a clear color rather than null to match what
     12        we do in the getters for "tintedColor" and "rawColor".
     13
     14        * UserInterface/ColorWheel.js:
     15        (WebInspector.ColorWheel.prototype._colorAtPointWithBrightness):
     16
    1172013-12-04  Antoine Quint  <graouts@apple.com>
    218
  • trunk/Source/WebInspectorUI/UserInterface/ColorWheel.js

    r160132 r160143  
    232232        var distance = Math.sqrt(xDis * xDis + yDis * yDis);
    233233
    234         if (distance > center)
    235             return null;
     234        if (distance - center > 0.001)
     235            return new WebInspector.Color(WebInspector.Color.Format.RGBA, [0, 0, 0, 0]);
    236236
    237237        var h = Math.atan2(y - center, center - x) * 180 / Math.PI;
Note: See TracChangeset for help on using the changeset viewer.