-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for joysticks in layouts in the runtimes. Diffs= a134ab656 Layout joysticks runtime (#7923) Co-authored-by: Philip Chung <[email protected]>
- Loading branch information
Showing
7 changed files
with
81 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
728ac6286912a1bf9987a91488c698668bd67354 | ||
a134ab6564748353fa4278483f91fe784b0b9c0a |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef _RIVE_INTRINSICALLY_SIZEABLE_HPP_ | ||
#define _RIVE_INTRINSICALLY_SIZEABLE_HPP_ | ||
|
||
#include <stdint.h> | ||
#include "rive/component.hpp" | ||
#include "rive/layout/layout_measure_mode.hpp" | ||
#include "rive/math/vec2d.hpp" | ||
|
||
namespace rive | ||
{ | ||
class IntrinsicallySizeable | ||
{ | ||
public: | ||
virtual Vec2D measureLayout(float width, | ||
LayoutMeasureMode widthMode, | ||
float height, | ||
LayoutMeasureMode heightMode) | ||
{ | ||
return Vec2D(); | ||
} | ||
|
||
virtual void controlSize(Vec2D size) {} | ||
static IntrinsicallySizeable* from(Component* component); | ||
}; | ||
} // namespace rive | ||
#endif |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "rive/intrinsically_sizeable.hpp" | ||
#include "rive/joystick.hpp" | ||
#include "rive/transform_component.hpp" | ||
|
||
using namespace rive; | ||
|
||
IntrinsicallySizeable* IntrinsicallySizeable::from(Component* component) | ||
{ | ||
switch (component->coreType()) | ||
{ | ||
case TransformComponent::typeKey: | ||
return component->as<TransformComponent>(); | ||
case Joystick::typeKey: | ||
return component->as<Joystick>(); | ||
} | ||
return nullptr; | ||
} |
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