Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Merge pull request #333 from Broken-Gem-Studio/ProgressBarFix
Browse files Browse the repository at this point in the history
Update ComponentProgressBar.cpp
  • Loading branch information
lucho1 authored May 6, 2020
2 parents 1a49b03 + bc29db8 commit e990cf0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Broken Engine/Source/ComponentProgressBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ void ComponentProgressBar::DrawPlane(Color color, float _percentage)
{
// --- Frame image with camera ---
float nearp = App->renderer3D->active_camera->GetNearPlane();
float3 pos = { position2D.x / App->gui->sceneWidth, position2D.y / App->gui->sceneHeight, nearp + 0.026f };


float size_x = ((size2D.x * _percentage) / 100);
float3 size = { size_x / App->gui->sceneWidth, size2D.y / App->gui->sceneHeight, 1.0f };

float3 pos = { (position2D.x + size_x / 2 - size2D.x / 2) / App->gui->sceneWidth, position2D.y / App->gui->sceneHeight, nearp + 0.026f };

float4x4 transform = transform.FromTRS(pos, Quat::identity, size);

//float4x4 transform = transform.FromTRS(position, App->renderer3D->active_camera->GetOpenGLViewMatrix().RotatePart(),
Expand Down

0 comments on commit e990cf0

Please sign in to comment.