Skip to content

Commit

Permalink
fix: compile button layout
Browse files Browse the repository at this point in the history
Signed-off-by: rokamu623 <r.okamura.061@ms.saitama-u.ac.jp>
  • Loading branch information
rokamu623 committed Apr 3, 2023
1 parent 9ebe51e commit 6472374
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions HowToDAGScheduling/MainGameScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ MainGameScene::MainGameScene(const InitData& init) :IScene{ init }
_stage_title = Font(24)(DAGJsonReader::get_stage_name(getData().path.value_or(U"DAG/sample_dag.json")));

_home_button_pos = Point(SEManager::UI_SIZE().x - int(SimpleGUI::ButtonRegion(U"🏠", Point()).w * 1.5), 0);
_compile_button_pos = LAYOUT::MERGIN * 2 + Point(LAYOUT::SCHED_SPACE_SIZE.x, LAYOUT::DAG_SPACE_SIZE.y) + Point(0, LAYOUT::STAZE_SPACE_HEIGHT) +
LAYOUT::SPACE_SPACE_SIZE * Point(1, 0) - SimpleGUI::ButtonRegion(U"COMPILE", Point()).size.asPoint() * Point(1, 0);
}

void MainGameScene::update()
Expand Down Expand Up @@ -37,7 +39,7 @@ void MainGameScene::draw() const
_grid.draw_field();
_compiler.draw_field();

SimpleGUI::Button(U"COMPILE", Vec2(600, 300));
SimpleGUI::Button(U"COMPILE", _compile_button_pos);
SimpleGUI::Button(U"🏠", _home_button_pos);

_grid.draw();
Expand All @@ -55,7 +57,7 @@ void NormalGameScene::update()
_dag.fit(_grid);
_dag.update();
MainGameScene::update();
if (SimpleGUI::Button(U"COMPILE", Vec2(600, 300)))
if (SimpleGUI::Button(U"COMPILE", _compile_button_pos))
{
_compiler.compile(_dag, _grid, getData().path.value_or(U"DAG/sample_dag.json"));
}
Expand All @@ -79,7 +81,7 @@ void ProcessorGameScene::update()
_dag.fit(_grid);
_dag.update();
MainGameScene::update();
if (SimpleGUI::Button(U"COMPILE", Vec2(600, 300)))
if (SimpleGUI::Button(U"COMPILE", _compile_button_pos))
{
_compiler.compile(_dag, _grid, getData().path.value_or(U"DAG/sample_dag.json"));
}
Expand Down
1 change: 1 addition & 0 deletions HowToDAGScheduling/MainGameScene.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class MainGameScene : public App::Scene
DrawableText _stage_title;

Point _home_button_pos;
Point _compile_button_pos;

public:
MainGameScene(const InitData& init);
Expand Down

0 comments on commit 6472374

Please sign in to comment.