Skip to content
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

[bug] 窗体左移 #105

Closed
Cologler opened this issue Oct 27, 2017 · 18 comments
Closed

[bug] 窗体左移 #105

Cologler opened this issue Oct 27, 2017 · 18 comments

Comments

@Cologler
Copy link
Contributor

在文件列表中按 ↓ 或 ↑ 会使预览窗体左移

@xupefei
Copy link
Member

xupefei commented Oct 27, 2017 via email

@Cologler
Copy link
Contributor Author

ts

逐渐挡住日期

@xupefei
Copy link
Member

xupefei commented Oct 28, 2017

我找了一些图片试了试,并没有发现这个现象。
方便的话,可以把这些图片打包给我吗?
Mail: xupaddy#@#gmail#@#com

@Cologler
Copy link
Contributor Author

Cologler commented Oct 28, 2017 via email

@xupefei
Copy link
Member

xupefei commented Oct 28, 2017

我是用了一些尺寸相同的照片测试的,没有发现这种现象。所以我怀疑是图片的问题……

video_2017-10-28_231329

@Cologler
Copy link
Contributor Author

Cologler commented Oct 28, 2017

我的图片也全是相同分辨率的,840x1200。我的是 portable 版,不过和这个可能没啥关系。
会不会你修复了这个问题?我用的 0.3.1 版本,左上角只有两个按钮,你的截图有 3 个。

@xupefei
Copy link
Member

xupefei commented Oct 30, 2017

你可以下载最新的 Nightly 版试试看。

@Cologler
Copy link
Contributor Author

Cologler commented Oct 30, 2017 via email

@xupefei
Copy link
Member

xupefei commented Oct 30, 2017 via email

@Cologler
Copy link
Contributor Author

分辨率是标准 1080P,缩放是 100%。

@Cologler
Copy link
Contributor Author

调试了下,在这个位置:

https://github.com/xupefei/QuickLook/blob/master/QuickLook/MainWindowTransparent.xaml.cs#L272

每次 call 的时候 this.Left 会减 1。

应该是 WindowHelper.MoveWindow()double 转 pixel 时候导致的失真。
试着改成宽高差距小于 2px 时不调用 MoveWindow() 就好了。

话说为什么要用 win32 的方法去移动窗体而不用 wpf 的方法呢?

@xupefei
Copy link
Member

xupefei commented Oct 30, 2017 via email

@Cologler
Copy link
Contributor Author

还有 QuickLook.NativeMethods.GetCurrentSelection() 中为什么会有这样一段代码?:

// communicate with COM in a separate thread
Task.Run(() =>
{
    sb = new StringBuilder(MaxPath);
    if (App.Is64Bit)
        GetCurrentSelectionNative_64(sb);
    else
        GetCurrentSelectionNative_32(sb);
}).Wait();

改成

sb = new StringBuilder(MaxPath);
if (App.Is64Bit)
    GetCurrentSelectionNative_64(sb);
else
    GetCurrentSelectionNative_32(sb);

不会更快些吗?

@xupefei
Copy link
Member

xupefei commented Oct 30, 2017 via email

@Cologler
Copy link
Contributor Author

嗯,四舍五入 Math.Round() 就好了。

你是用 VS 编译的吗?我这里编译时 ps1 生成的 gitversion 提示版本字符串不合法……

@xupefei
Copy link
Member

xupefei commented Oct 30, 2017

手动执行一下 Scripts/update-version.ps1 试试看。
应该生成类似 1.2.3.4-abcdef 的东西。

@xupefei
Copy link
Member

xupefei commented Oct 30, 2017

PS:愿意的话你可以提个 PR。

@Cologler
Copy link
Contributor Author

我知道为啥我编译不了了……我只 clone 了深度 1,所以没有 tag……

xupefei added a commit that referenced this issue Oct 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants