-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Comments
给个屏幕录像?
cheers,
Paddy
From: cologler
Sent: 27 October 2017 15:39
To: xupefei/QuickLook
Cc: Subscribed
Subject: [xupefei/QuickLook] [bug] 窗体左移 (#105)
在文件列表中按 ↓ 或 ↑ 会使预览窗体左移
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
我找了一些图片试了试,并没有发现这个现象。 |
我的图片也全是相同分辨率的,840x1200。我的是 portable 版,不过和这个可能没啥关系。 |
你可以下载最新的 Nightly 版试试看。 |
分辨率是标准 1080P,缩放是 100%。 |
调试了下,在这个位置: https://github.com/xupefei/QuickLook/blob/master/QuickLook/MainWindowTransparent.xaml.cs#L272 每次 call 的时候 应该是 话说为什么要用 win32 的方法去移动窗体而不用 wpf 的方法呢? |
把 TransformToPixels 里的 (int) 改成四舍五入试试看?
WPF不能同时修改 Left 和 Top,而分别修改会造成窗口两次刷新。
cheers,
Paddy
… On 30 Oct 2017, at 15:09, cologler ***@***.***> wrote:
调试了下,在这个位置:
https://github.com/xupefei/QuickLook/blob/master/QuickLook/MainWindowTransparent.xaml.cs#L272 <https://github.com/xupefei/QuickLook/blob/master/QuickLook/MainWindowTransparent.xaml.cs#L272>
每次 call 的时候 this.Left 会减 1。
应该是 WindowHelper.MoveWindow() 中 double 转 pixel 时候导致的失真。
试着改成宽高差距小于 2px 时不调用 MoveWindow() 就好了。
话说为什么要用 win32 的方法去移动窗体而不用 wpf 的方法呢?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#105 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABnBJ1-SpiEtYmPBg8wS4t8hM16O4br5ks5sxcqcgaJpZM4QI_x7>.
|
还有 // 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); 不会更快些吗? |
你可以试试,会报错 :-)
连接 COM 需要 STA 线程。
cheers,
Paddy
… On 30 Oct 2017, at 15:14, cologler ***@***.***> wrote:
还有 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);
不会更快些吗?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#105 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABnBJ6Ms2nychCLCb_0vXdnWDhs41sJXks5sxcvGgaJpZM4QI_x7>.
|
嗯,四舍五入 你是用 VS 编译的吗?我这里编译时 ps1 生成的 gitversion 提示版本字符串不合法…… |
手动执行一下 Scripts/update-version.ps1 试试看。 |
PS:愿意的话你可以提个 PR。 |
我知道为啥我编译不了了……我只 clone 了深度 1,所以没有 tag…… |
在文件列表中按 ↓ 或 ↑ 会使预览窗体左移
The text was updated successfully, but these errors were encountered: