Skip to content

Commit

Permalink
Change GUI Objects to call custom copy constructor (s0TPiFsJY1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Neko-Box-Coder committed Jul 23, 2023
1 parent 45561de commit 4772ae1
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Include/ssGUI/GUIObjectClasses/Widget.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace ssGUI
Widget& operator=(Widget const& other) = default;

protected:
Widget(Widget const& other) = default;
Widget(Widget const& other);

virtual void ConstructRenderInfo() override;
virtual void MainLogic(ssGUI::Backend::BackendSystemInputInterface* inputInterface, ssGUI::InputStatus& inputStatus,
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/GUIObjectClasses/Window.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ namespace ssGUI
virtual void OnMouseDragOrResizeUpdate(ssGUI::InputStatus& inputStatus, glm::vec2 mouseDelta, ssGUI::Backend::BackendSystemInputInterface* inputInterface);
virtual void BlockMouseInputAndUpdateCursor(ssGUI::InputStatus& inputStatus, glm::vec2 currentMousePos, ssGUI::Backend::BackendSystemInputInterface* inputInterface);

Window(Window const& other) = default;
Window(Window const& other);
virtual void ConstructRenderInfo() override;
virtual void MainLogic(ssGUI::Backend::BackendSystemInputInterface* inputInterface, ssGUI::InputStatus& inputStatus,
ssGUI::GUIObject* mainWindow) override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ namespace

namespace ssGUI
{
StandardSlider::StandardSlider(StandardSlider const& other) : SliderTitleTextObject(other.SliderTitleTextObject),
StandardSlider::StandardSlider(StandardSlider const& other) : Widget(other),
SliderTitleTextObject(other.SliderTitleTextObject),
SliderObject(other.SliderObject),
SliderDisplayValueTextObject(other.SliderDisplayValueTextObject),
MinDisplayValue(other.MinDisplayValue),
Expand Down
6 changes: 6 additions & 0 deletions Src/ssGUI/GUIObjectClasses/Widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

namespace ssGUI
{
Widget::Widget(Widget const& other) : GUIObject(other),
Interactable(other.Interactable),
BlockInput(other.BlockInput)
{
}

void Widget::ConstructRenderInfo()
{
//Internal_Draw background by default
Expand Down
25 changes: 25 additions & 0 deletions Src/ssGUI/GUIObjectClasses/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,31 @@ namespace ssGUI
ssLOG_FUNC_EXIT();
}

Window::Window(Window const& other) : GUIObject(other),
Titlebar(other.Titlebar),
TitlebarHeight(other.TitlebarHeight),
ResizeType(other.ResizeType),
Draggable(other.Draggable),
Closable(other.Closable),
Closed(other.Closed),
IsClosingAborted(other.IsClosingAborted),
TitlebarColorDifference(other.TitlebarColorDifference),
AdaptiveTitlebarColor(other.AdaptiveTitlebarColor),
DeleteAfterClosed(other.DeleteAfterClosed),
OnTopWhenFocused(other.OnTopWhenFocused),
CurrentDragState(ssGUI::Enums::WindowDragState::NONE),
ResizeHitbox(other.ResizeHitbox),
ResizingTop(false),
ResizingBot(false),
ResizingLeft(false),
ResizingRight(false),
Dragging(false),
TransformTotalMovedDistance(),
OnTransformBeginSize(),
MouseDownPosition()
{
}

void Window::ConstructRenderInfo()
{
glm::vec2 drawPosition = GetGlobalPosition();
Expand Down

0 comments on commit 4772ae1

Please sign in to comment.