@@ -383,7 +383,7 @@ public class Gala.WindowCloneContainer : ActorTarget {
383383 // https://projects.kde.org/projects/kde/kde-workspace/repository/revisions/master/entry/kwin/effects/presentwindows/presentwindows.cpp
384384
385385 // some math utilities
386- private static int squared_distance (Gdk . Point a, Gdk . Point b) {
386+ private static float squared_distance (Graphene . Point a, Graphene . Point b) {
387387 var k1 = b. x - a. x;
388388 var k2 = b. y - a. y;
389389
@@ -394,7 +394,7 @@ public class Gala.WindowCloneContainer : ActorTarget {
394394 return {rect. x + dx1, rect. y + dy1, rect. width + (- dx1 + dx2), rect. height + (- dy1 + dy2)};
395395 }
396396
397- private static Gdk . Point rect_center (Mtk . Rectangle rect) {
397+ private static Graphene . Point rect_center (Mtk . Rectangle rect) {
398398 return {rect. x + rect. width / 2 , rect. y + rect. height / 2 };
399399 }
400400
@@ -419,7 +419,7 @@ public class Gala.WindowCloneContainer : ActorTarget {
419419 taken_slots. resize (rows * columns);
420420
421421 // precalculate all slot centers
422- Gdk . Point [] slot_centers = {};
422+ Graphene . Point [] slot_centers = {};
423423 slot_centers. resize (rows * columns);
424424 for (int x = 0 ; x < columns; x++ ) {
425425 for (int y = 0 ; y < rows; y++ ) {
@@ -437,7 +437,7 @@ public class Gala.WindowCloneContainer : ActorTarget {
437437 var rect = window. rect;
438438
439439 var slot_candidate = - 1 ;
440- var slot_candidate_distance = int . MAX ;
440+ var slot_candidate_distance = float . MAX ;
441441 var pos = rect_center (rect);
442442
443443 // all slots
@@ -510,8 +510,8 @@ public class Gala.WindowCloneContainer : ActorTarget {
510510 if (scale > 1.0 ) {
511511 scale = 1.0f ;
512512 target = {
513- rect_center (target). x - ( int ) Math . floorf (rect. width * scale) / 2 ,
514- rect_center (target). y - ( int ) Math . floorf (rect. height * scale) / 2 ,
513+ ( int ) ( rect_center (target). x - Math . floorf (rect. width * scale) / 2 ) ,
514+ ( int ) ( rect_center (target). y - Math . floorf (rect. height * scale) / 2 ) ,
515515 (int ) Math . floorf (scale * rect. width),
516516 (int ) Math . floorf (scale * rect. height)
517517 };
0 commit comments