-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Fix wrong y-axis range in writeImage() on Windows #39
Conversation
for y := 0; y < height; y++ { height-y } returns height ~ 1
It looks like some failure tests are real. |
I think a following code fix the problem. diff --git a/clipboard_windows.go b/clipboard_windows.go
index b7a8d5e..70fbd18 100644
--- a/clipboard_windows.go
+++ b/clipboard_windows.go
@@ -145,7 +145,7 @@ func readImage() ([]byte, error) {
// xhat := (x + int(info.Width-3)) % int(info.Width)
xhat := (x + int(info.Width)) % int(info.Width)
- yhat := int(info.Height) - y
+ yhat := int(info.Height) - 1 - y
r := data[idx+2]
g := data[idx+1]
b := data[idx+0]
|
Type is different.
|
`for y := 0; y < int(info.Height); y++ { yhat := int(info.Height) - y }` returns height ~ 1
Absorb inconsistent color type
readImage() and clipboard_test.go are updated. |
What if we just update the test file? |
A type of img2.At() as So I tried to convert to RGBA64 and compare. It seems img2.At() returns type vary depending the image has transparent color or not. |
RGBA64At() is not declared at v1.16
for y := 0; y < height; y++ { height-y }
returns height ~ 1