Skip to content

Commit 674e105

Browse files
committed
Replace Gdk.Point with Graphene.Point
1 parent 3363522 commit 674e105

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

plugins/pip/SelectionArea.vala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ public class Gala.Plugins.PIP.SelectionArea : CanvasActor {
2323
public Gala.WindowManager wm { get; construct; }
2424

2525
private Gala.ModalProxy? modal_proxy;
26-
private Gdk.Point start_point;
27-
private Gdk.Point end_point;
26+
private Graphene.Point start_point;
27+
private Graphene.Point end_point;
2828
private bool dragging = false;
2929
private bool clicked = false;
3030

@@ -130,10 +130,10 @@ public class Gala.Plugins.PIP.SelectionArea : CanvasActor {
130130
}
131131

132132
private void get_selection_rectangle (out int x, out int y, out int width, out int height) {
133-
x = int.min (start_point.x, end_point.x);
134-
y = int.min (start_point.y, end_point.y);
135-
width = (start_point.x - end_point.x).abs ();
136-
height = (start_point.y - end_point.y).abs ();
133+
x = (int) float.min (start_point.x, end_point.x);
134+
y = (int) float.min (start_point.y, end_point.y);
135+
width = (int) (start_point.x - end_point.x).abs ();
136+
height = (int) (start_point.y - end_point.y).abs ();
137137
}
138138

139139
protected override void draw (Cairo.Context ctx, int width, int height) {

src/Widgets/MultitaskingView/WindowCloneContainer.vala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)