Separating safe window area from window area
This commit is contained in:
parent
97d299a346
commit
b1f6f04d37
18 changed files with 121 additions and 102 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#include <include/core/SkPath.h>
|
||||
#include <include/core/SkPathBuilder.h>
|
||||
#include "../GUIManager.hpp"
|
||||
#include "../../TimePoint.hpp"
|
||||
|
||||
namespace GUIStuff {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
#pragma once
|
||||
#include "Helpers/ConvertVec.hpp"
|
||||
#include <include/core/SkCanvas.h>
|
||||
#include "../../TimePoint.hpp"
|
||||
#include <Eigen/Dense>
|
||||
#include <include/core/SkFont.h>
|
||||
#include <include/core/SkFontMgr.h>
|
||||
|
|
@ -12,7 +11,6 @@
|
|||
#include <Helpers/SCollision.hpp>
|
||||
#include <Helpers/Serializers.hpp>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include "../../RichText/TextBox.hpp"
|
||||
#include "../../InputManager.hpp"
|
||||
#include "../GUIManagerID.hpp"
|
||||
|
||||
|
|
@ -108,8 +106,8 @@ struct UpdateInputData {
|
|||
float deltaTime = 0.0f;
|
||||
|
||||
float guiScaleMultiplier = 1.0f;
|
||||
Vector2f windowPos = {0.0f, 0.0f};
|
||||
Vector2f windowSize = {0.0f, 0.0f};
|
||||
SCollision::AABB<float> safeWindowRect;
|
||||
|
||||
std::shared_ptr<FontData> fonts;
|
||||
sk_sp<SkTypeface> textTypeface;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ void PositionAdjustingPopupMenu::layout(const Clay_ElementId& id, Vector2f popup
|
|||
auto& bb = layoutElement->get_bb().value();
|
||||
if((popupPos.y() + bb.height()) > gui.io.windowSize.y())
|
||||
popupPos.y() -= bb.height();
|
||||
if((popupPos.x() + bb.width()) > gui.io.windowSize.x())
|
||||
if((popupPos.x() + bb.width()) > gui.io.windowSize.y())
|
||||
popupPos.x() -= bb.width();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include "RadioButton.hpp"
|
||||
#include "../GUIManager.hpp"
|
||||
#include "../../TimePoint.hpp"
|
||||
|
||||
namespace GUIStuff {
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ template <typename T> void TextBox<T>::clay_draw(SkCanvas* canvas, UpdateInputDa
|
|||
|
||||
template <typename T> void TextBox<T>::select() {
|
||||
if(!is_selected()) {
|
||||
SCollision::AABB<float> rect = {(boundingBox.value().min + gui.io.windowPos) * gui.io.guiScaleMultiplier, (boundingBox.value().max + gui.io.windowPos) * gui.io.guiScaleMultiplier};
|
||||
SCollision::AABB<float> rect = {boundingBox.value().min * gui.io.guiScaleMultiplier, boundingBox.value().max * gui.io.guiScaleMultiplier};
|
||||
unsigned id = gui.io.input->set_text_box_front(rect, userInfo.textInputProps);
|
||||
edit = TextEditData(id, textbox, cur);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue