Browse Source

ColorPicker: fix the position of cursor (#12376)

why 7 years ago
parent
commit
3d3a2233ee
1 changed files with 1 additions and 3 deletions
  1. 1 3
      packages/color-picker/src/components/sv-panel.vue

+ 1 - 3
packages/color-picker/src/components/sv-panel.vue

@@ -47,9 +47,7 @@
         const value = this.color.get('value');
 
         const el = this.$el;
-        let { width, height } = el.getBoundingClientRect();
-
-        if (!height) height = width * 3 / 4;
+        let { clientWidth: width, clientHeight: height } = el;
 
         this.cursorLeft = saturation * width / 100;
         this.cursorTop = (100 - value) * height / 100;