fix zoom bug.
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -68,10 +68,6 @@ public class MultipleMonitorCreator : MonoBehaviour
|
|||||||
{
|
{
|
||||||
ResetRemoveTimer();
|
ResetRemoveTimer();
|
||||||
|
|
||||||
// Sort monitors in coordinate order
|
|
||||||
var monitors = uDesktopDuplication.Manager.monitors;
|
|
||||||
monitors.Sort((a, b) => a.left - b.left);
|
|
||||||
|
|
||||||
// Create monitors
|
// Create monitors
|
||||||
for (int i = 0; i < uDesktopDuplication.Manager.monitorCount; ++i) {
|
for (int i = 0; i < uDesktopDuplication.Manager.monitorCount; ++i) {
|
||||||
// Create monitor obeject
|
// Create monitor obeject
|
||||||
@@ -104,6 +100,9 @@ public class MultipleMonitorCreator : MonoBehaviour
|
|||||||
info.mesh = mesh;
|
info.mesh = mesh;
|
||||||
monitors_.Add(info);
|
monitors_.Add(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sort monitors in coordinate order
|
||||||
|
monitors_.Sort((a, b) => a.uddTexture.monitor.left - b.uddTexture.monitor.left);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Clear()
|
void Clear()
|
||||||
|
|||||||
Binary file not shown.
@@ -85,6 +85,8 @@ public static class Lib
|
|||||||
[DllImport("uDesktopDuplication")]
|
[DllImport("uDesktopDuplication")]
|
||||||
public static extern IntPtr GetRenderEventFunc();
|
public static extern IntPtr GetRenderEventFunc();
|
||||||
[DllImport("uDesktopDuplication")]
|
[DllImport("uDesktopDuplication")]
|
||||||
|
public static extern int GetId(int id);
|
||||||
|
[DllImport("uDesktopDuplication")]
|
||||||
public static extern MonitorState GetState(int id);
|
public static extern MonitorState GetState(int id);
|
||||||
[DllImport("uDesktopDuplication")]
|
[DllImport("uDesktopDuplication")]
|
||||||
public static extern void GetName(int id, StringBuilder buf, int len);
|
public static extern void GetName(int id, StringBuilder buf, int len);
|
||||||
|
|||||||
@@ -24,16 +24,16 @@ void Cursor::UpdateBuffer(const DXGI_OUTDUPL_FRAME_INFO& frameInfo)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
x_ = frameInfo.PointerPosition.Position.x;
|
|
||||||
y_ = frameInfo.PointerPosition.Position.y;
|
|
||||||
isVisible_ = frameInfo.PointerPosition.Visible != 0;
|
isVisible_ = frameInfo.PointerPosition.Visible != 0;
|
||||||
timestamp_ = frameInfo.LastMouseUpdateTime;
|
|
||||||
|
|
||||||
if (isVisible_)
|
if (isVisible_)
|
||||||
{
|
{
|
||||||
GetMonitorManager()->SetCursorMonitorId(monitor_->GetId());
|
GetMonitorManager()->SetCursorMonitorId(monitor_->GetId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
x_ = frameInfo.PointerPosition.Position.x;
|
||||||
|
y_ = frameInfo.PointerPosition.Position.y;
|
||||||
|
timestamp_ = frameInfo.LastMouseUpdateTime;
|
||||||
|
|
||||||
if (!IsCursorOnParentMonitor())
|
if (!IsCursorOnParentMonitor())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -138,6 +138,15 @@ extern "C"
|
|||||||
g_manager->SetTimeout(timeout);
|
g_manager->SetTimeout(timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UNITY_INTERFACE_EXPORT void UNITY_INTERFACE_API GetId(int id)
|
||||||
|
{
|
||||||
|
if (!g_manager) return;
|
||||||
|
if (auto monitor = g_manager->GetMonitor(id))
|
||||||
|
{
|
||||||
|
monitor->GetId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UNITY_INTERFACE_EXPORT MonitorState UNITY_INTERFACE_API GetState(int id)
|
UNITY_INTERFACE_EXPORT MonitorState UNITY_INTERFACE_API GetState(int id)
|
||||||
{
|
{
|
||||||
if (!g_manager) return MonitorState::NotSet;
|
if (!g_manager) return MonitorState::NotSet;
|
||||||
|
|||||||
Reference in New Issue
Block a user