Line
Link Here
|
0 |
-- Base (BASE) |
0 |
++ Locally Modified (Based On LOCAL) |
Lines 78-83
Link Here
|
78 |
Collection<Rectangle> regions = collector.getRegions (widget); |
78 |
Collection<Rectangle> regions = collector.getRegions (widget); |
79 |
|
79 |
|
80 |
if (horizontal) { |
80 |
if (horizontal) { |
|
|
81 |
boolean middle = false; |
82 |
int mx = 0; |
83 |
int b3 = sceneWidgetBounds.x + (sceneWidgetBounds.width/2); |
84 |
|
81 |
boolean snap = false; |
85 |
boolean snap = false; |
82 |
int xs = 0, x = 0, dx = 0, y1 = 0, y2 = 0; |
86 |
int xs = 0, x = 0, dx = 0, y1 = 0, y2 = 0; |
83 |
|
87 |
|
Lines 87-92
Link Here
|
87 |
for (Rectangle rectangle : regions) { |
91 |
for (Rectangle rectangle : regions) { |
88 |
int a1 = rectangle.x; |
92 |
int a1 = rectangle.x; |
89 |
int a2 = a1 + rectangle.width; |
93 |
int a2 = a1 + rectangle.width; |
|
|
94 |
int a3 = a1 +(rectangle.width/2); |
90 |
|
95 |
|
91 |
int d; |
96 |
int d; |
92 |
boolean snapNow = false; |
97 |
boolean snapNow = false; |
Lines 125-130
Link Here
|
125 |
} |
130 |
} |
126 |
} |
131 |
} |
127 |
|
132 |
|
|
|
133 |
d = Math.abs(a3 - b3); |
134 |
if((snap && d <dx) || (!snap && d < GRAVITY)){ |
135 |
snap = snapNow = middle = true; |
136 |
x = xs = a3 - (b3-b1); |
137 |
mx = a3; |
138 |
dx = d; |
139 |
} |
140 |
|
128 |
if (snapNow) { |
141 |
if (snapNow) { |
129 |
y1 = rectangle.y; |
142 |
y1 = rectangle.y; |
130 |
y2 = rectangle.y + rectangle.height; |
143 |
y2 = rectangle.y + rectangle.height; |
Lines 146-151
Link Here
|
146 |
} |
159 |
} |
147 |
|
160 |
|
148 |
if (vertical) { |
161 |
if (vertical) { |
|
|
162 |
boolean middle = false; |
163 |
int my = 0; |
164 |
int b3 = sceneWidgetBounds.y + (sceneWidgetBounds.height/2); |
149 |
boolean snap = false; |
165 |
boolean snap = false; |
150 |
int ys = 0, y = 0, dy = 0, x1 = 0, x2 = 0; |
166 |
int ys = 0, y = 0, dy = 0, x1 = 0, x2 = 0; |
151 |
|
167 |
|
Lines 155-160
Link Here
|
155 |
for (Rectangle rectangle : regions) { |
171 |
for (Rectangle rectangle : regions) { |
156 |
int a1 = rectangle.y; |
172 |
int a1 = rectangle.y; |
157 |
int a2 = a1 + rectangle.height; |
173 |
int a2 = a1 + rectangle.height; |
|
|
174 |
int a3 = a1 + (rectangle.height/2); |
158 |
|
175 |
|
159 |
int d; |
176 |
int d; |
160 |
boolean snapNow = false; |
177 |
boolean snapNow = false; |
Lines 189-194
Link Here
|
189 |
dy = d; |
206 |
dy = d; |
190 |
} |
207 |
} |
191 |
|
208 |
|
|
|
209 |
d = Math.abs(a3 - b3); |
210 |
if((snap && d <dy) || (!snap && d < GRAVITY)){ |
211 |
snap = snapNow = middle = true; |
212 |
y = ys = a3 - (b3-b1); |
213 |
my = a3; |
214 |
dy = d; |
215 |
} |
216 |
|
192 |
if (snapNow) { |
217 |
if (snapNow) { |
193 |
x1 = rectangle.x; |
218 |
x1 = rectangle.x; |
194 |
x2 = rectangle.x + rectangle.width; |
219 |
x2 = rectangle.x + rectangle.width; |