appDisplay: Fix indicator animation position
The original position was calculated with the stage and the transformed position of the indicator when mapped. The values were wrong on some situations, so lets calculate the position based on the dots width. https://bugzilla.gnome.org/show_bug.cgi?id=707580
This commit is contained in:
parent
72f0a48fac
commit
7c78e1fbf5
@ -233,13 +233,11 @@ const PageIndicators = new Lang.Class({
|
|||||||
let timePerChild = INDICATORS_ANIMATION_TIME / this._nPages;
|
let timePerChild = INDICATORS_ANIMATION_TIME / this._nPages;
|
||||||
let delay = INDICATORS_ANIMATION_DELAY_PERCENTAGE / 100 * timePerChild;
|
let delay = INDICATORS_ANIMATION_DELAY_PERCENTAGE / 100 * timePerChild;
|
||||||
|
|
||||||
let [stageX, ] = children[0].get_transformed_position();
|
|
||||||
let offset;
|
let offset;
|
||||||
let monitor = Main.layoutManager.primaryMonitor;
|
if (this.actor.get_text_direction() == Clutter.TextDirection.RTL)
|
||||||
if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL)
|
offset = -children[0].width;
|
||||||
offset = monitor.x - stageX - children[0].width;
|
|
||||||
else
|
else
|
||||||
offset = monitor.x + monitor.width - stageX;
|
offset = children[0].width;
|
||||||
|
|
||||||
for (let i = 0; i < this._nPages; i++) {
|
for (let i = 0; i < this._nPages; i++) {
|
||||||
children[i].translation_x = offset;
|
children[i].translation_x = offset;
|
||||||
|
Loading…
Reference in New Issue
Block a user