mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-29 23:32:04 +02:00
Fix chapter popover coordinates
This commit is contained in:
15
src/controls.js
vendored
15
src/controls.js
vendored
@@ -435,12 +435,19 @@ class ClapperControls extends Gtk.Box
|
|||||||
if(isVisible) {
|
if(isVisible) {
|
||||||
const [start, end] = this.positionScale.get_slider_range();
|
const [start, end] = this.positionScale.get_slider_range();
|
||||||
const controlsHeight = this.parent.get_height();
|
const controlsHeight = this.parent.get_height();
|
||||||
const scaleHeight = this.positionScale.parent.get_height();
|
const scaleBoxHeight = this.positionScale.parent.get_height();
|
||||||
|
const [isShared, destX, destY] = this.positionScale.translate_coordinates(
|
||||||
|
this.positionScale.parent, 0, 0
|
||||||
|
);
|
||||||
|
|
||||||
|
/* Half of slider width, values are defined in CSS */
|
||||||
|
const sliderOffset = (this.isFullscreen && !this.isMobile)
|
||||||
|
? 10 : 9;
|
||||||
|
|
||||||
this.chapterPopover.set_pointing_to(new Gdk.Rectangle({
|
this.chapterPopover.set_pointing_to(new Gdk.Rectangle({
|
||||||
x: -2,
|
x: destX + end - sliderOffset,
|
||||||
y: -(controlsHeight - scaleHeight) / 2,
|
y: -(controlsHeight - scaleBoxHeight) / 2,
|
||||||
width: 2 * end,
|
width: 0,
|
||||||
height: 0,
|
height: 0,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user