render and server locale parity fixes
This commit is contained in:
@@ -154,6 +154,26 @@ static void drawing_primitives()
|
||||
graphic.RenderCoolTimeBox(100, 100, 10, 1.0f);
|
||||
CHECK(commands.empty());
|
||||
|
||||
// A cooldown triangle crossing the viewport must have clipped vertices, not only a clipped bbox.
|
||||
UIRenderSetClip(95, 95, 10, 10);
|
||||
graphic.RenderCoolTimeBox(100, 100, 10, 0.25f);
|
||||
CHECK(!commands.empty());
|
||||
bool touched_clip_edge = false;
|
||||
for (const auto& command : commands)
|
||||
{
|
||||
CHECK(command.kind == UIRenderCommand::Bar && command.quad);
|
||||
for (int vertex = 0; vertex < 3; ++vertex)
|
||||
{
|
||||
CHECK(command.qx[vertex] >= 95 && command.qx[vertex] <= 105);
|
||||
CHECK(command.qy[vertex] >= 95 && command.qy[vertex] <= 105);
|
||||
touched_clip_edge |= near(command.qx[vertex], 95) || near(command.qx[vertex], 105) ||
|
||||
near(command.qy[vertex], 95) || near(command.qy[vertex], 105);
|
||||
}
|
||||
}
|
||||
CHECK(touched_clip_edge);
|
||||
UIRenderRestoreClip();
|
||||
UIRenderBeginFrame();
|
||||
|
||||
// CPythonGraphic::SetViewport also clips the UI commands to the viewport until RestoreViewport.
|
||||
graphic.SetViewport(10, 20, 30, 40);
|
||||
screen.RenderBar2d(0, 0, 5, 5);
|
||||
|
||||
Reference in New Issue
Block a user