Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multiple issues #177

Closed
wants to merge 23 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update widget snaping comment
  • Loading branch information
felix-andreas committed Aug 23, 2019
commit b39e75ec3e0a9b9eb886167c8223a6c8863de27a
11 changes: 5 additions & 6 deletions src/Widgets/DisplaysOverlay.vala
Original file line number Diff line number Diff line change
Expand Up @@ -486,11 +486,11 @@ public class Display.DisplaysOverlay : Gtk.Overlay {

/**
* Widget snaping is done by trying to snap the current widget to other widgets called anchors.
*
* I) At first it is checked if it is possible to snap a widget using only horizontal or
* only veritcal translation. This condition can checked be calculating the intersection of
* a test_rect and the current anchor_rect. If the two rectangles intersect the the distance
* to the closest edge gets calculated. Afterwards the widgets snaps to the closest anchor.
* only veritcal translation. This can be done by using four different test_rects which occupy
* the area to the left, to the right, at the top and at the bottom of the widget, respectively.
* If a test_rect intersects with one of the other anchor_rects the distance to the closest edge
* of the anchor get calculated. Afterwards the widgets snaps to the closest anchor.
*
* Cases: W = widget, A = current anchor
*
Expand All @@ -499,7 +499,7 @@ public class Display.DisplaysOverlay : Gtk.Overlay {
* A W
*
* II) If it is not possible to snap the widget horizontally or vertically to any edge,
* the widget is snaped diagonally to the nearest corner.
* the widget is snaped diagonally to the nearest corner of an anchor.
*/

private void snap_widget (Display.DisplayWidget widget, List<Display.DisplayWidget> anchors) {
Expand Down Expand Up @@ -603,7 +603,6 @@ public class Display.DisplaysOverlay : Gtk.Overlay {
}
}

// Snap widget
if (widget.holding) {
widget.delta_x += distance_x;
widget.delta_y += distance_y;
Expand Down