-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SUTK] Vertical Text Scrolling and various other improvements
- Added IGfxDriver::getObject() function to query reference to SGE::RenderObject in a unified way - Added InputDriver::getOnScrollEvent() to implement text scrolling - Renamed Renderable::setClipRect to setClipRectGlobalCoords and created a local variant which expects coordinates in the local space of its renderable container's parent. - Implemented Caret Rendering and clipping inside the textbox etc; and text scrolling (up and down) using the scroll wheel.
- Loading branch information
Showing
13 changed files
with
164 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,29 @@ | ||
#include <sutk/Renderable.hpp> | ||
#include <sutk/RenderableContainer.hpp> // for SUTK::RenderableContainer::setRenderable() | ||
#include <sutk/IGfxDriver.hpp> | ||
|
||
namespace SUTK | ||
{ | ||
Renderable::Renderable(UIDriver& driver, RenderableContainer* container) noexcept : UIDriverObject(driver), m_container(container) | ||
{ | ||
if(container != NULL) | ||
container->setRenderable(this); | ||
driver.m_renderables.push_back(this); | ||
} | ||
|
||
void GfxDriverRenderable::setClipRectGlobalCoords(const Rect2Df rect) noexcept | ||
{ | ||
auto handle = getGfxDriverObjectHandle(); | ||
getGfxDriver().setObjectScissor(getGfxDriver().getObject(handle), rect); | ||
} | ||
|
||
void GfxDriverRenderable::setClipRect(const Rect2Df rect) noexcept | ||
{ | ||
Container* container = getContainer(); | ||
if(container->getParent() != NULL) | ||
container = container->getParent(); | ||
// convert the top-left corner of the container, in which renderable is, to global coordinates | ||
auto position = container->getLocalCoordsToScreenCoords(rect.getPosition()); | ||
setClipRectGlobalCoords({ position, rect.getSize() }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.