From 97bdd3bc194903d83456aa7f7464867699c4ec4f Mon Sep 17 00:00:00 2001 From: Scott Wittenburg Date: Tue, 18 Dec 2018 16:20:22 -0700 Subject: [PATCH] Fix aspect ratio of logo image so it is not stretched or squashed Also add two new tests that make sure logo stays the right aspect ratio whether the canvas is tall/narrow or short/wide. --- tests/.last_failure | 1 + tests/test_vcs_draw_logo_on.py | 14 +++++++++ tests/test_vcs_png_window_resize2_.png | Bin 0 -> 20436 bytes vcs/VTKPlots.py | 42 +++++++++++++++++++++---- 4 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 tests/.last_failure create mode 100644 tests/test_vcs_png_window_resize2_.png diff --git a/tests/.last_failure b/tests/.last_failure new file mode 100644 index 000000000..3f1573cf0 --- /dev/null +++ b/tests/.last_failure @@ -0,0 +1 @@ +['/data/scott/projects/uvcdat/vcs/tests/test_vcs_boxfill_10x10_numpy.py', '/data/scott/projects/uvcdat/vcs/tests/test_vcs_flake8.py', '/data/scott/projects/uvcdat/vcs/tests/test_vcs_line_patterns.py', '/data/scott/projects/uvcdat/vcs/tests/test_vcs_boxfill_10x10_masked_numpy.py', '/data/scott/projects/uvcdat/vcs/tests/test_vcs_flipXY.py', '/data/scott/projects/uvcdat/vcs/tests/test_vcs_isofill_mask_cell_shift.py', '/data/scott/projects/uvcdat/vcs/tests/test_vcs_fillarea_concave.py', '/data/scott/projects/uvcdat/vcs/tests/test_vcs_flipNone.py', '/data/scott/projects/uvcdat/vcs/tests/test_vcs_remove_marker_none_1d.py', '/data/scott/projects/uvcdat/vcs/tests/test_vcs_settings_color_name_rgba_isofill.py', '/data/scott/projects/uvcdat/vcs/tests/test_vcs_wmo_w07_marker.py', '/data/scott/projects/uvcdat/vcs/tests/test_vcs_isoline_numpy.py', '/data/scott/projects/uvcdat/vcs/tests/test_vcs_1D_in_boxfill.py', '/data/scott/projects/uvcdat/vcs/tests/test_vcs_1D_with_manyDs.py', '/data/scott/projects/uvcdat/vcs/tests/test_vcs_meshfill_vertices.py', '/data/scott/projects/uvcdat/vcs/tests/test_vcs_user_passed_date_as_string.py', '/data/scott/projects/uvcdat/vcs/tests/test_vcs_isoline_extend_attributes.py', '/data/scott/projects/uvcdat/vcs/tests/test_vcs_missing_colorname.py', '/data/scott/projects/uvcdat/vcs/tests/test_vcs_polar_set_opt_param_polar.py', '/data/scott/projects/uvcdat/vcs/tests/test_vcs_meshfill_vertices_issue.py', '/data/scott/projects/uvcdat/vcs/tests/test_vcs_boxfill_datawc_time.py', '/data/scott/projects/uvcdat/vcs/tests/test_vcs_plot_file_var.py', '/data/scott/projects/uvcdat/vcs/tests/test_vcs_large_pattern_hatch.py'] \ No newline at end of file diff --git a/tests/test_vcs_draw_logo_on.py b/tests/test_vcs_draw_logo_on.py index 327494665..c29360cd9 100644 --- a/tests/test_vcs_draw_logo_on.py +++ b/tests/test_vcs_draw_logo_on.py @@ -14,3 +14,17 @@ def testDrawLogoOn(self): self.x.plot(a, bg=self.bg) fnm = "test_vcs_draw_logo_on.png" self.checkImage(fnm) + + self.x.clear() + self.x.drawlogoon() + self.x.geometry(800, 400) + self.x.plot(a, bg=self.bg) + fnm = "test_vcs_draw_logo_on_wide.png" + self.checkImage(fnm) + + self.x.clear() + self.x.drawlogoon() + self.x.geometry(400, 800) + self.x.plot(a, bg=self.bg) + fnm = "test_vcs_draw_logo_on_tall.png" + self.checkImage(fnm) diff --git a/tests/test_vcs_png_window_resize2_.png b/tests/test_vcs_png_window_resize2_.png new file mode 100644 index 0000000000000000000000000000000000000000..9d2941b7d02a7c89e1a85410811e785bed4d9842 GIT binary patch literal 20436 zcmeHvd036_+Vxg%U-EM1v?w^Q>{D7D_Zy(umAMY1B+;5Q?O^ zlr+#hY3@7k^&9r|?)`n=@gB$f$9H^=WAFX!)wAyBe(w7k&g;C+d-?2B-!*sE@>vu` z%~e%V)}*Lu@f0<63GFw0VsW$eJ4G=lRb|D4XZ6}^-OgV7ZZOm{8X&2VaMb$Nv`-#i z*B?;36RaQ8vFT>^*FDc1QhqL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-7Kf57T}l5g}j#c+?7uM3g|NngC?g z<+lD6X~l=Xtw1mPo_eG+R_AV1?3-aATbz``LTG70t&oW~MhH)BXot(eo(FL{XAI}F z=I|n^kAY->l*RyG7a6&uL^FWs2c?^KnvD_dCeAUUWF-cIL%E_-u10Kgm{mXg!BL5Z z!_4qF)80V*M1y3#tGK*86QBvmTS`g_)ebuIrw)~8 zo0@z*b2TvV<0pW;7n54(65R=Wq`uR1Y%fkYb<4LvZ1?Z*;D7t!|69cQ|DW)Gg3JHk cTBV8Enr0nZ4+7H75OFEh9qP(Ym5zJ imgAspect: + # We'll use the full vp height and adjust it's width so that it's + # aspect ratio matches that of the image (so no stretching of the + # image occurs). The image should be centered, so we'll offset + # position x value by half the difference. + vpWidth = vpHeight * imgAspect + halfDiff = ((position2[0] * renWinWidth) - vpWidth) / 2.0 + vpLowerLeftX += halfDiff + else: + # Similar to above, but in this case we choose to keep the vp width + # and adjust it's height. + vpHeight = vpWidth / imgAspect + halfDiff = ((position2[1] * renWinHeight) - vpHeight) / 2.0 + vpLowerLeftY += halfDiff + view = self.contextView area = vtk.vtkContextArea() view.GetScene().AddItem(area) - [renWinWidth, renWinHeight] = self.renWin.GetSize() dataBounds = vtk.vtkRectd(0.0, 0.0, imgWidth, imgHeight) - screenGeom = vtk.vtkRecti( - int(position[0] * renWinWidth), - int(position[1] * renWinHeight), - int(position2[0] * renWinWidth), - int(position2[1] * renWinHeight)) + screenGeom = vtk.vtkRecti(int(vpLowerLeftX), int(vpLowerLeftY), + int(vpWidth), int(vpHeight)) vcs2vtk.configureContextArea(area, dataBounds, screenGeom) area.GetDrawAreaItem().AddItem(item) + self.logoContextArea = area self.logoContextItem = item self.logoContextItemPython = pythonItem