Skip to content

Commit 88f4c65

Browse files
committed
Update app.cpp
1 parent c6186e0 commit 88f4c65

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/app.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -433,15 +433,15 @@ void SampleViewer::draw_gui()
433433
for (int i = 0; i < m_num_dimensions - 1; ++i)
434434
{
435435
float4x4 pos = layout_2d_matrix(m_num_dimensions, int2{i, m_num_dimensions - 1});
436-
float4 text_pos = mul(mvp, mul(pos, float4{0.f, -0.5f, 0.0f, 1.0f}));
436+
float4 text_pos = mul(mvp, mul(pos, float4{0.f, -0.5f, -1.0f, 1.0f}));
437437
float2 text_2d_pos((text_pos.x / text_pos.w + 1) / 2, (text_pos.y / text_pos.w + 1) / 2);
438438
draw_text(m_viewport_pos + int2(int((text_2d_pos.x) * m_viewport_size.x),
439439
int((1.f - text_2d_pos.y) * m_viewport_size.y) + 16),
440440
to_string(i), float4(1.0f, 1.0f, 1.0f, 0.75f), m_regular[16],
441441
TextAlign_CENTER | TextAlign_BOTTOM);
442442

443443
pos = layout_2d_matrix(m_num_dimensions, int2{0, i + 1});
444-
text_pos = mul(mvp, mul(pos, float4{-0.5f, 0.f, 0.0f, 1.0f}));
444+
text_pos = mul(mvp, mul(pos, float4{-0.5f, 0.f, -1.0f, 1.0f}));
445445
text_2d_pos = float2((text_pos.x / text_pos.w + 1) / 2, (text_pos.y / text_pos.w + 1) / 2);
446446
draw_text(m_viewport_pos + int2(int((text_2d_pos.x) * m_viewport_size.x) - 4,
447447
int((1.f - text_2d_pos.y) * m_viewport_size.y)),
@@ -1228,7 +1228,7 @@ void SampleViewer::update_points(bool regenerate)
12281228
for (int x = 0; x < y; ++x, ++plot_index)
12291229
for (int i = 0; i < m_subset_count; ++i)
12301230
m_2d_points[plot_index * m_subset_count + i] =
1231-
float3{m_subset_points(x, i), m_subset_points(y, i), 0.5f};
1231+
float3{m_subset_points(x, i), m_subset_points(y, i), -0.5f};
12321232

12331233
m_2d_point_shader->set_buffer("center", m_2d_points);
12341234
m_2d_point_shader->set_buffer_divisor("center", 1); // one center per quad/instance

0 commit comments

Comments
 (0)