mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-18 20:34:54 +08:00
Edge scroll, minor refactoring
This commit is contained in:
@@ -108,10 +108,10 @@ export default class Utility {
|
||||
*/
|
||||
static convertLocation(viewportLocation, movementElement, ignoreScale = false) {
|
||||
const scaleCorrection = ignoreScale ? 1 : 1 / Utility.getScale(movementElement)
|
||||
const targetOffset = movementElement.getBoundingClientRect()
|
||||
const bounding = movementElement.getBoundingClientRect()
|
||||
let location = [
|
||||
Math.round((viewportLocation[0] - targetOffset.x) * scaleCorrection),
|
||||
Math.round((viewportLocation[1] - targetOffset.y) * scaleCorrection)
|
||||
Math.round((viewportLocation[0] - bounding.x) * scaleCorrection),
|
||||
Math.round((viewportLocation[1] - bounding.y) * scaleCorrection)
|
||||
]
|
||||
return location
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user