-
Notifications
You must be signed in to change notification settings - Fork 204
vgx11: fix translate offset #188
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
Conversation
vg/vgx11/canvas_test.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No space after comma.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
I feel unsatisfied by the fact that the test is there but not run. It seems to me that a better approach would be to more heavily rely on vgimg (possibly extending it) to create the vgimg.Canvas and thereby trust the test for its creation in vg. |
|
alternatively, I could try to have the travis-ci actually run the X11 test. it seems to me like the approach you're advising would be more "testing vgimg" or "testing how xgbutil is using image" rather than actually testing how an X11 window is being displayed. |
461c3a9 to
69363f4
Compare
|
I'm happy if you can get travis to test the X11 behaviour.
|
|
PTAL. now the test is run if |
|
Do we need the windows build now? It seems not.
|
|
you mean the |
|
The entire canvas_nox11.go file.
|
|
The !windows constraint does need to be there - not for us, but for people on Windows who do go test themselves. |
|
the you are right though that even with the |
|
If there is only source for a non windows build environment the directory will be skipped when GOOS=windows. |
|
ok. I wasn't indeed completely sure this wasn't an artifact of my unorthodox way of simulating a Windows environment. |
|
Nope, you're right. That does not seem reasonable. But it is what it is. |
|
ok. removed |
|
I going to have a look at build and see why this is how it behaves. |
vg/vgx11/canvas.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I'd really like this to be "Package vgx11 implements X11 vg support." or words to that effect. The basis for the implementation is secondary and should not be in the first sentence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. (I was just following the other vg-foo backends descriptions)
|
I think it is a result of doing -tags=windows. When I change the build constraints to windows (without the bang), I get that error if the test is invoked in vgx11, but not if I invoke go test ./... in plot. I think we are good. LGTM apart from minor comment. Please wait for @eaburns though. |
vg/vgx11/canvas_test.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return os.Getenv("DISPLAY") != ""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
|
LGTM. |
|
I'm satisifed that it's correct. |
|
I'll rebase, squash and make a nice commit message. (tomorrow) |
- fixes gonum#179 for X11 too by translating the image to (0,-h) so (0,0) is at the bottom-left corner. - 'go test ./...' will skip the X11 test if $DISPLAY is not defined. - setup xvfb in travis-ci to test X11
Address issue #179 by translating the image to (0,-h) so (0,0) is at the
bottom-left corner for the X11 backend.
go test ./...will skip the X11 test if$DISPLAYis not defined.