-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1557 from UV-CDAT/1446_portrait_mode
Fix view rotation when rendering in background mode
- Loading branch information
Showing
4 changed files
with
70 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import vcs | ||
import numpy | ||
|
||
data = numpy.sin(numpy.arange(100)) | ||
data = numpy.reshape(data, (10, 10)) | ||
|
||
x = vcs.init() | ||
x.plot(data, bg=1) | ||
assert x.orientation() == "landscape", "Default canvas orientation failed" | ||
c = x.canvasinfo() | ||
assert c['width'] == 814, "Default canvas width failed" | ||
assert c['height'] == 606, "Default canvas height failed" | ||
|
||
x.clear() | ||
x.portrait() | ||
x.plot(data, bg=1) | ||
assert x.orientation() == "portrait", "Portrait canvas orientation failed" | ||
c = x.canvasinfo() | ||
assert c['width'] == 606, "Portrait canvas width failed" | ||
assert c['height'] == 814, "Portrait canvas height failed" | ||
|
||
x.clear() | ||
x.landscape() | ||
x.plot(data, bg=1) | ||
assert x.orientation() == "landscape", "Landscape canvas orientation failed" | ||
c = x.canvasinfo() | ||
assert c['width'] == 814, "Landscape canvas width failed" | ||
assert c['height'] == 606, "Landscape canvas height failed" | ||
|
||
x.clear() | ||
x.landscape() | ||
x.plot(data, bg=1) | ||
assert x.orientation() == "landscape", "Landscape canvas orientation failed" | ||
c = x.canvasinfo() | ||
assert c['width'] == 814, "Landscape canvas width failed" | ||
assert c['height'] == 606, "Landscape canvas height failed" | ||
|
||
x.clear() | ||
x.portrait() | ||
x.plot(data, bg=1) | ||
assert x.orientation() == "portrait", "Portrait canvas orientation failed" | ||
c = x.canvasinfo() | ||
assert c['width'] == 606, "Portrait canvas width failed" | ||
assert c['height'] == 814, "Portrait canvas height failed" |