1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
|
/* Copyright 2009-2015 Yorba Foundation
*
* This software is licensed under the GNU LGPL (version 2.1 or later).
* See the COPYING file in this distribution.
*/
public enum ScaleConstraint {
ORIGINAL,
DIMENSIONS,
WIDTH,
HEIGHT,
FILL_VIEWPORT;
public string? to_string() {
switch (this) {
case ORIGINAL:
return _("Original size");
case DIMENSIONS:
return _("Width or height");
case WIDTH:
return _("Width");
case HEIGHT:
return _("Height");
case FILL_VIEWPORT:
// TODO: Translate (not used in UI at this point)
return "Fill Viewport";
}
warn_if_reached();
return null;
}
}
public struct Dimensions {
public int width;
public int height;
public Dimensions(int width = 0, int height = 0) {
if ((width < 0) || (height < 0))
warning("Tried to construct a Dimensions object with negative width or height - forcing sensible default values.");
this.width = width.clamp(0, width);
this.height = height.clamp(0, height);
}
public static Dimensions for_pixbuf(Gdk.Pixbuf pixbuf) {
return Dimensions(pixbuf.get_width(), pixbuf.get_height());
}
public static Dimensions for_allocation(Gtk.Allocation allocation) {
return Dimensions(allocation.width, allocation.height);
}
public static Dimensions for_widget_allocation(Gtk.Widget widget) {
Gtk.Allocation allocation;
widget.get_allocation(out allocation);
return Dimensions(allocation.width, allocation.height);
}
public static Dimensions for_rectangle(Gdk.Rectangle rect) {
return Dimensions(rect.width, rect.height);
}
public bool has_area() {
return (width > 0 && height > 0);
}
public Dimensions floor(Dimensions min = Dimensions(1, 1)) {
return Dimensions((width > min.width) ? width : min.width,
(height > min.height) ? height : min.height);
}
public string to_string() {
return "%dx%d".printf(width, height);
}
public bool equals(Dimensions dim) {
return (width == dim.width && height == dim.height);
}
// sometimes a pixel or two is okay
public bool approx_equals(Dimensions dim, int fudge = 1) {
return (width - dim.width).abs() <= fudge && (height - dim.height).abs() <= fudge;
}
public bool approx_scaled(int scale, int fudge = 1) {
return (width <= (scale + fudge)) && (height <= (scale + fudge));
}
public int major_axis() {
return int.max(width, height);
}
public int minor_axis() {
return int.min(width, height);
}
public Dimensions with_min(int min_width, int min_height) {
return Dimensions(int.max(width, min_width), int.max(height, min_height));
}
public Dimensions with_max(int max_width, int max_height) {
return Dimensions(int.min(width, max_width), int.min(height, max_height));
}
public Dimensions get_scaled(int scale, bool scale_up) {
assert(scale > 0);
// check for existing best-fit
if ((width == scale && height < scale) || (height == scale && width < scale))
return Dimensions(width, height);
// watch for scaling up
if (!scale_up && (width < scale && height < scale))
return Dimensions(width, height);
if ((width - scale) > (height - scale))
return get_scaled_by_width(scale);
else
return get_scaled_by_height(scale);
}
public void get_scale_ratios(Dimensions scaled, out double width_ratio, out double height_ratio) {
width_ratio = (double) scaled.width / (double) width;
height_ratio = (double) scaled.height / (double) height;
}
public double get_aspect_ratio() {
return ((double) width) / height;
}
public Dimensions get_scaled_proportional(Dimensions viewport) {
double width_ratio, height_ratio;
get_scale_ratios(viewport, out width_ratio, out height_ratio);
double scaled_width, scaled_height;
if (width_ratio < height_ratio) {
scaled_width = viewport.width;
scaled_height = (double) height * width_ratio;
} else {
scaled_width = (double) width * height_ratio;
scaled_height = viewport.height;
}
Dimensions scaled = Dimensions((int) Math.round(scaled_width),
(int) Math.round(scaled_height)).floor();
assert(scaled.height <= viewport.height);
assert(scaled.width <= viewport.width);
return scaled;
}
public Dimensions get_scaled_to_fill_viewport(Dimensions viewport) {
double width_ratio, height_ratio;
get_scale_ratios(viewport, out width_ratio, out height_ratio);
double scaled_width, scaled_height;
if (width < viewport.width && height >= viewport.height) {
// too narrow
scaled_width = viewport.width;
scaled_height = (double) height * width_ratio;
} else if (width >= viewport.width && height < viewport.height) {
// too short
scaled_width = (double) width * height_ratio;
scaled_height = viewport.height;
} else {
// both are smaller or larger
double ratio = double.max(width_ratio, height_ratio);
scaled_width = (double) width * ratio;
scaled_height = (double) height * ratio;
}
return Dimensions((int) Math.round(scaled_width), (int) Math.round(scaled_height)).floor();
}
public Gdk.Rectangle get_scaled_rectangle(Dimensions scaled, Gdk.Rectangle rect) {
double x_scale, y_scale;
get_scale_ratios(scaled, out x_scale, out y_scale);
Gdk.Rectangle scaled_rect = Gdk.Rectangle();
scaled_rect.x = (int) Math.round((double) rect.x * x_scale);
scaled_rect.y = (int) Math.round((double) rect.y * y_scale);
scaled_rect.width = (int) Math.round((double) rect.width * x_scale);
scaled_rect.height = (int) Math.round((double) rect.height * y_scale);
if (scaled_rect.width <= 0)
scaled_rect.width = 1;
if (scaled_rect.height <= 0)
scaled_rect.height = 1;
return scaled_rect;
}
// Returns the current dimensions scaled in a similar proportion as the two suppled dimensions
public Dimensions get_scaled_similar(Dimensions original, Dimensions scaled) {
double x_scale, y_scale;
original.get_scale_ratios(scaled, out x_scale, out y_scale);
double scale = double.min(x_scale, y_scale);
return Dimensions((int) Math.round((double) width * scale),
(int) Math.round((double) height * scale)).floor();
}
public Dimensions get_scaled_by_width(int scale) {
assert(scale > 0);
double ratio = (double) scale / (double) width;
return Dimensions(scale, (int) Math.round((double) height * ratio)).floor();
}
public Dimensions get_scaled_by_height(int scale) {
assert(scale > 0);
double ratio = (double) scale / (double) height;
return Dimensions((int) Math.round((double) width * ratio), scale).floor();
}
public Dimensions get_scaled_by_constraint(int scale, ScaleConstraint constraint) {
switch (constraint) {
case ScaleConstraint.ORIGINAL:
return Dimensions(width, height);
case ScaleConstraint.DIMENSIONS:
return (width >= height) ? get_scaled_by_width(scale) : get_scaled_by_height(scale);
case ScaleConstraint.WIDTH:
return get_scaled_by_width(scale);
case ScaleConstraint.HEIGHT:
return get_scaled_by_height(scale);
default:
error("Bad constraint: %d", (int) constraint);
}
}
}
public struct Scaling {
private const int NO_SCALE = 0;
public ScaleConstraint constraint;
public int scale;
public Dimensions viewport;
public bool scale_up;
private Scaling(ScaleConstraint constraint, int scale, Dimensions viewport, bool scale_up) {
this.constraint = constraint;
this.scale = scale;
this.viewport = viewport;
this.scale_up = scale_up;
}
public static Scaling for_original() {
return Scaling(ScaleConstraint.ORIGINAL, NO_SCALE, Dimensions(), false);
}
public static Scaling for_screen(Gtk.Window window, bool scale_up) {
return for_viewport(get_screen_dimensions(window), scale_up);
}
public static Scaling for_best_fit(int pixels, bool scale_up) {
assert(pixels > 0);
return Scaling(ScaleConstraint.DIMENSIONS, pixels, Dimensions(), scale_up);
}
public static Scaling for_viewport(Dimensions viewport, bool scale_up) {
assert(viewport.has_area());
return Scaling(ScaleConstraint.DIMENSIONS, NO_SCALE, viewport, scale_up);
}
public static Scaling for_widget(Gtk.Widget widget, bool scale_up) {
Dimensions viewport = Dimensions.for_widget_allocation(widget);
// Because it seems that Gtk.Application realizes the main window and its
// attendant widgets lazily, it's possible to get here with the PhotoPage's
// canvas believing it is 1px by 1px, which can lead to a scaling that
// gdk_pixbuf_scale_simple can't handle.
//
// If we get here, and the widget we're being drawn into is 1x1, then, most likely,
// it's not fully realized yet (since nothing in Shotwell requires this), so just
// ignore it and return something safe instead.
if ((viewport.width <= 1) || (viewport.height <= 1))
return for_original();
return Scaling(ScaleConstraint.DIMENSIONS, NO_SCALE, viewport, scale_up);
}
public static Scaling to_fill_viewport(Dimensions viewport) {
// Please see the comment in Scaling.for_widget as to why this is
// required.
if ((viewport.width <= 1) || (viewport.height <= 1))
return for_original();
return Scaling(ScaleConstraint.FILL_VIEWPORT, NO_SCALE, viewport, true);
}
public static Scaling to_fill_screen(Gtk.Window window) {
return to_fill_viewport(get_screen_dimensions(window));
}
public static Scaling for_constraint(ScaleConstraint constraint, int scale, bool scale_up) {
return Scaling(constraint, scale, Dimensions(), scale_up);
}
private static Dimensions get_screen_dimensions(Gtk.Window window) {
Gdk.Screen screen = window.get_screen();
return Dimensions(screen.get_width(), screen.get_height());
}
private int scale_to_pixels() {
return (scale >= 0) ? scale : 0;
}
public bool is_unscaled() {
return constraint == ScaleConstraint.ORIGINAL;
}
public bool is_best_fit(Dimensions original, out int pixels) {
pixels = 0;
if (scale == NO_SCALE)
return false;
switch (constraint) {
case ScaleConstraint.ORIGINAL:
case ScaleConstraint.FILL_VIEWPORT:
return false;
default:
pixels = scale_to_pixels();
assert(pixels > 0);
return true;
}
}
public bool is_best_fit_dimensions(Dimensions original, out Dimensions scaled) {
scaled = Dimensions();
if (scale == NO_SCALE)
return false;
switch (constraint) {
case ScaleConstraint.ORIGINAL:
case ScaleConstraint.FILL_VIEWPORT:
return false;
default:
int pixels = scale_to_pixels();
assert(pixels > 0);
scaled = original.get_scaled_by_constraint(pixels, constraint);
return true;
}
}
public bool is_for_viewport(Dimensions original, out Dimensions scaled) {
scaled = Dimensions();
if (scale != NO_SCALE)
return false;
switch (constraint) {
case ScaleConstraint.ORIGINAL:
case ScaleConstraint.FILL_VIEWPORT:
return false;
default:
assert(viewport.has_area());
if (!scale_up && original.width < viewport.width && original.height < viewport.height)
scaled = original;
else
scaled = original.get_scaled_proportional(viewport);
return true;
}
}
public bool is_fill_viewport(Dimensions original, out Dimensions scaled) {
scaled = Dimensions();
if (constraint != ScaleConstraint.FILL_VIEWPORT)
return false;
assert(viewport.has_area());
scaled = original.get_scaled_to_fill_viewport(viewport);
return true;
}
public Dimensions get_scaled_dimensions(Dimensions original) {
if (is_unscaled())
return original;
Dimensions scaled;
if (is_fill_viewport(original, out scaled))
return scaled;
if (is_best_fit_dimensions(original, out scaled))
return scaled;
bool is_viewport = is_for_viewport(original, out scaled);
assert(is_viewport);
return scaled;
}
public Gdk.Pixbuf perform_on_pixbuf(Gdk.Pixbuf pixbuf, Gdk.InterpType interp, bool scale_up) {
if (is_unscaled())
return pixbuf;
Dimensions pixbuf_dim = Dimensions.for_pixbuf(pixbuf);
int pixels;
if (is_best_fit(pixbuf_dim, out pixels))
return scale_pixbuf(pixbuf, pixels, interp, scale_up);
Dimensions scaled;
if (is_fill_viewport(pixbuf_dim, out scaled))
return resize_pixbuf(pixbuf, scaled, interp);
bool is_viewport = is_for_viewport(pixbuf_dim, out scaled);
assert(is_viewport);
return resize_pixbuf(pixbuf, scaled, interp);
}
public string to_string() {
if (constraint == ScaleConstraint.ORIGINAL)
return "scaling: UNSCALED";
else if (constraint == ScaleConstraint.FILL_VIEWPORT)
return "scaling: fill viewport %s".printf(viewport.to_string());
else if (scale != NO_SCALE)
return "scaling: best-fit (%s %d pixels %s)".printf(constraint.to_string(),
scale_to_pixels(), scale_up ? "scaled up" : "not scaled up");
else
return "scaling: viewport %s (%s)".printf(viewport.to_string(),
scale_up ? "scaled up" : "not scaled up");
}
public bool equals(Scaling scaling) {
return (constraint == scaling.constraint) && (scale == scaling.scale)
&& viewport.equals(scaling.viewport);
}
}
public struct ZoomState {
public Dimensions content_dimensions;
public Dimensions viewport_dimensions;
public double zoom_factor;
public double interpolation_factor;
public double min_factor;
public double max_factor;
public Gdk.Point viewport_center;
public ZoomState(Dimensions content_dimensions, Dimensions viewport_dimensions,
double slider_val = 0.0, Gdk.Point? viewport_center = null) {
this.content_dimensions = content_dimensions;
this.viewport_dimensions = viewport_dimensions;
this.interpolation_factor = slider_val;
compute_zoom_factors();
if ((viewport_center == null) || ((viewport_center.x == 0) && (viewport_center.y == 0)) ||
(slider_val == 0.0)) {
center_viewport();
} else {
this.viewport_center = viewport_center;
clamp_viewport_center();
}
}
public ZoomState.rescale(ZoomState existing, double new_slider_val) {
this.content_dimensions = existing.content_dimensions;
this.viewport_dimensions = existing.viewport_dimensions;
this.interpolation_factor = new_slider_val;
compute_zoom_factors();
if (new_slider_val == 0.0) {
center_viewport();
} else {
viewport_center.x = (int) (zoom_factor * (existing.viewport_center.x /
existing.zoom_factor));
viewport_center.y = (int) (zoom_factor * (existing.viewport_center.y /
existing.zoom_factor));
clamp_viewport_center();
}
}
public ZoomState.rescale_to_isomorphic(ZoomState existing) {
this.content_dimensions = existing.content_dimensions;
this.viewport_dimensions = existing.viewport_dimensions;
this.interpolation_factor = Math.log(1.0 / existing.min_factor) /
(Math.log(existing.max_factor / existing.min_factor));
compute_zoom_factors();
if (this.interpolation_factor == 0.0) {
center_viewport();
} else {
viewport_center.x = (int) (zoom_factor * (existing.viewport_center.x /
existing.zoom_factor));
viewport_center.y = (int) (zoom_factor * (existing.viewport_center.y /
existing.zoom_factor));
clamp_viewport_center();
}
}
public ZoomState.pan(ZoomState existing, Gdk.Point new_viewport_center) {
this.content_dimensions = existing.content_dimensions;
this.viewport_dimensions = existing.viewport_dimensions;
this.interpolation_factor = existing.interpolation_factor;
compute_zoom_factors();
this.viewport_center = new_viewport_center;
clamp_viewport_center();
}
private void clamp_viewport_center() {
int zoomed_width = get_zoomed_width();
int zoomed_height = get_zoomed_height();
viewport_center.x = viewport_center.x.clamp(viewport_dimensions.width / 2,
zoomed_width - (viewport_dimensions.width / 2) - 1);
viewport_center.y = viewport_center.y.clamp(viewport_dimensions.height / 2,
zoomed_height - (viewport_dimensions.height / 2) - 1);
}
private void center_viewport() {
viewport_center.x = get_zoomed_width() / 2;
viewport_center.y = get_zoomed_height() / 2;
}
private void compute_zoom_factors() {
max_factor = 2.0;
double viewport_to_content_x;
double viewport_to_content_y;
content_dimensions.get_scale_ratios(viewport_dimensions, out viewport_to_content_x,
out viewport_to_content_y);
min_factor = double.min(viewport_to_content_x, viewport_to_content_y);
if (min_factor > 1.0)
min_factor = 1.0;
zoom_factor = min_factor * Math.pow(max_factor / min_factor, interpolation_factor);
}
public double get_interpolation_factor() {
return interpolation_factor;
}
/* gets the viewing rectangle with respect to the zoomed content */
public Gdk.Rectangle get_viewing_rectangle_wrt_content() {
int zoomed_width = get_zoomed_width();
int zoomed_height = get_zoomed_height();
Gdk.Rectangle result = Gdk.Rectangle();
if (viewport_dimensions.width < zoomed_width) {
result.x = viewport_center.x - (viewport_dimensions.width / 2);
} else {
result.x = (zoomed_width - viewport_dimensions.width) / 2;
}
if (result.x < 0)
result.x = 0;
if (viewport_dimensions.height < zoomed_height) {
result.y = viewport_center.y - (viewport_dimensions.height / 2);
} else {
result.y = (zoomed_height - viewport_dimensions.height) / 2;
}
if (result.y < 0)
result.y = 0;
int right = result.x + viewport_dimensions.width;
if (right > zoomed_width)
right = zoomed_width;
result.width = right - result.x;
int bottom = result.y + viewport_dimensions.height;
if (bottom > zoomed_height)
bottom = zoomed_height;
result.height = bottom - result.y;
result.width = result.width.clamp(1, int.MAX);
result.height = result.height.clamp(1, int.MAX);
return result;
}
/* gets the viewing rectangle with respect to the on-screen canvas where zoomed content is
drawn */
public Gdk.Rectangle get_viewing_rectangle_wrt_screen() {
Gdk.Rectangle wrt_content = get_viewing_rectangle_wrt_content();
Gdk.Rectangle result = Gdk.Rectangle();
result.x = (viewport_dimensions.width / 2) - (wrt_content.width / 2);
if (result.x < 0)
result.x = 0;
result.y = (viewport_dimensions.height / 2) - (wrt_content.height / 2);
if (result.y < 0)
result.y = 0;
result.width = wrt_content.width;
result.height = wrt_content.height;
return result;
}
/* gets the projection of the viewing rectangle into the arbitrary pixbuf 'for_pixbuf' */
public Gdk.Rectangle get_viewing_rectangle_projection(Gdk.Pixbuf for_pixbuf) {
double zoomed_width = get_zoomed_width();
double zoomed_height = get_zoomed_height();
double horiz_scale = for_pixbuf.width / zoomed_width;
double vert_scale = for_pixbuf.height / zoomed_height;
double scale = (horiz_scale + vert_scale) / 2.0;
Gdk.Rectangle viewing_rectangle = get_viewing_rectangle_wrt_content();
Gdk.Rectangle result = Gdk.Rectangle();
result.x = (int) (viewing_rectangle.x * scale);
result.x = result.x.clamp(0, for_pixbuf.width);
result.y = (int) (viewing_rectangle.y * scale);
result.y = result.y.clamp(0, for_pixbuf.height);
int right = (int) ((viewing_rectangle.x + viewing_rectangle.width) * scale);
right = right.clamp(0, for_pixbuf.width);
int bottom = (int) ((viewing_rectangle.y + viewing_rectangle.height) * scale);
bottom = bottom.clamp(0, for_pixbuf.height);
result.width = right - result.x;
result.height = bottom - result.y;
return result;
}
public double get_zoom_factor() {
return zoom_factor;
}
public int get_zoomed_width() {
return (int) (content_dimensions.width * zoom_factor);
}
public int get_zoomed_height() {
return (int) (content_dimensions.height * zoom_factor);
}
public Gdk.Point get_viewport_center() {
return viewport_center;
}
public string to_string() {
string named_modes = "";
if (is_min())
named_modes = named_modes + ((named_modes == "") ? "MIN" : ", MIN");
if (is_default())
named_modes = named_modes + ((named_modes == "") ? "DEFAULT" : ", DEFAULT");
if (is_isomorphic())
named_modes = named_modes + ((named_modes =="") ? "ISOMORPHIC" : ", ISOMORPHIC");
if (is_max())
named_modes = named_modes + ((named_modes =="") ? "MAX" : ", MAX");
if (named_modes == "")
named_modes = "(none)";
Gdk.Rectangle viewing_rect = get_viewing_rectangle_wrt_content();
return (("ZoomState {\n content dimensions = %d x %d;\n viewport dimensions = " +
"%d x %d;\n min factor = %f;\n max factor = %f;\n current factor = %f;" +
"\n zoomed width = %d;\n zoomed height = %d;\n named modes = %s;" +
"\n viewing rectangle = { x: %d, y: %d, width: %d, height: %d };" +
"\n viewport center = (%d, %d);\n}\n").printf(
content_dimensions.width, content_dimensions.height, viewport_dimensions.width,
viewport_dimensions.height, min_factor, max_factor, zoom_factor, get_zoomed_width(),
get_zoomed_height(), named_modes, viewing_rect.x, viewing_rect.y, viewing_rect.width,
viewing_rect.height, viewport_center.x, viewport_center.y));
}
public bool is_min() {
return (zoom_factor == min_factor);
}
public bool is_default() {
return is_min();
}
public bool is_max() {
return (zoom_factor == max_factor);
}
public bool is_isomorphic() {
return (zoom_factor == 1.0);
}
public bool equals(ZoomState other) {
if (!content_dimensions.equals(other.content_dimensions))
return false;
if (!viewport_dimensions.equals(other.viewport_dimensions))
return false;
if (zoom_factor != other.zoom_factor)
return false;
if (min_factor != other.min_factor)
return false;
if (max_factor != other.max_factor)
return false;
if (viewport_center.x != other.viewport_center.x)
return false;
if (viewport_center.y != other.viewport_center.y)
return false;
return true;
}
}
|