Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
EastDesire committed Oct 18, 2022
2 parents a93586c + 0c87424 commit da93f23
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions jscolor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1100,8 +1100,14 @@ var jsc = {
var vShadow = contractShadow ? 0 : thisObj.shadowBlur; // px

jsc.picker.wrap.style.position = positionValue;
jsc.picker.wrap.style.left = x + 'px';
jsc.picker.wrap.style.top = y + 'px';

if ( // To avoid unnecessary repositioning during scroll
Math.round(parseFloat(jsc.picker.wrap.style.left)) !== Math.round(x) ||
Math.round(parseFloat(jsc.picker.wrap.style.top)) !== Math.round(y)
) {
jsc.picker.wrap.style.left = x + 'px';
jsc.picker.wrap.style.top = y + 'px';
}

jsc.setBoxShadow(
jsc.picker.boxS,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eastdesire/jscolor",
"version": "2.5.0",
"version": "2.5.1",
"description": "Web color picker with opacity channel (alpha channel) and custom palette. Supports CSS colors such as rgba() and hex, including #rrggbbaa.",
"main": "jscolor.js",
"scripts": {
Expand Down

0 comments on commit da93f23

Please sign in to comment.