Преглед на файлове

ColorPicker: fix the position of cursor (#12376)

why преди 7 години
родител
ревизия
3d3a2233ee
променени са 1 файла, в които са добавени 1 реда и са изтрити 3 реда
  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;