Skip to content

Commit

Permalink
fix wrong calculation for keymapping grid with css scale transform rules
Browse files Browse the repository at this point in the history
  • Loading branch information
jparez committed Aug 7, 2024
1 parent 236bc8f commit 9ea4dc6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/plugins/KeyboardMapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,14 @@ module.exports = class KeyboardMapping {
if (isActive) {
const parentSize = this.instance.videoWrapper.getBoundingClientRect();
const videoSize = this.instance.video.getBoundingClientRect();
videoSize.height = videoSize.height - this.instance.coordinateUtils.getTopBorder() * 2;

if (!this.instance.coordinateUtils.hasLeftAndRightBorders()) {
// landscape: border top
videoSize.height = (this.instance.video.videoHeight / this.instance.video.videoWidth) * videoSize.width;
} else {
// portrait: border left
videoSize.width = (this.instance.video.videoWidth / this.instance.video.videoHeight) * videoSize.height;
}

// div vertical
Array.from(Array(11).keys()).forEach((val, i) => {
Expand Down

0 comments on commit 9ea4dc6

Please sign in to comment.