Skip to content

Commit

Permalink
Merge pull request ymm-tech#20 from 214132049/master
Browse files Browse the repository at this point in the history
修复节点旋转后点击放大问题
  • Loading branch information
jy03078959 authored Oct 18, 2019
2 parents 9012aa5 + ff4dcfd commit f3688ce
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/Selecter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,17 @@
var thisNode = this.$parent
var parentNode = this.$parent.$parent || {}
var size = dimensionAnyTopx(thisNode.$el, parentNode.$el)
var thisNodeStyle = thisNode.$el.style || window.getComputedStyle(thisNode.$el)
var hasTransform = (thisNodeStyle.getPropertyValue('transform') || 'none') !== 'none'
// 若此节点发生选择 会导致通过 getBoundingClientRect 获取的值发生变化 致使旋转后点击变大
// issue: https://github.com/ymm-tech/gods-pen/issues/18
if (hasTransform) {
// 发生了旋转
var properties = ['width', 'height', 'left', 'top', 'right', 'bottom']
properties.forEach(prop => {
size[prop] = parseFloat(thisNodeStyle.getPropertyValue(prop))
})
}
this.startPos = {
size: size.rect,
parentSize: size.parentRect,
Expand Down

0 comments on commit f3688ce

Please sign in to comment.