mirror of
				https://github.com/ocornut/imgui.git
				synced 2025-10-26 12:27:30 +00:00 
			
		
		
		
	Nav: Mouse pos passed to backend always rounded, so that lossy application of non-integer mouse pos doesn't lead to undesirable movement (#3
This commit is contained in:
		| @@ -2377,7 +2377,7 @@ static ImVec2 NavCalcPreferredMousePos() | |||||||
|         return g.IO.MousePos; |         return g.IO.MousePos; | ||||||
|     ImVec2 p = g.NavWindow->Pos + ImVec2(g.NavRefRectRel.Min.x + ImMin(g.Style.FramePadding.x*4, g.NavRefRectRel.GetWidth()), g.NavRefRectRel.Max.y - ImMin(g.Style.FramePadding.y, g.NavRefRectRel.GetHeight())); |     ImVec2 p = g.NavWindow->Pos + ImVec2(g.NavRefRectRel.Min.x + ImMin(g.Style.FramePadding.x*4, g.NavRefRectRel.GetWidth()), g.NavRefRectRel.Max.y - ImMin(g.Style.FramePadding.y, g.NavRefRectRel.GetHeight())); | ||||||
|     ImRect r = GetVisibleRect(); |     ImRect r = GetVisibleRect(); | ||||||
|     return ImClamp(p, r.Min, r.Max); |     return ImFloor(ImClamp(p, r.Min, r.Max));   // ImFloor() is important because non-integer mouse position application in backend might be lossy and result in undesirable non-zero delta. | ||||||
| } | } | ||||||
|  |  | ||||||
| static int FindWindowIndex(ImGuiWindow* window) // FIXME-OPT O(N) | static int FindWindowIndex(ImGuiWindow* window) // FIXME-OPT O(N) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 ocornut
					ocornut