Browse Source

Transforms should be updated when e.g. dragging window.

Michael 7 years ago
parent
commit
0a0da1a0ec

+ 3 - 3
Samples/invaders/src/EventManager.cpp

@@ -133,7 +133,7 @@ void EventManager::ProcessEvent(Rocket::Core::Event& event, const Rocket::Core::
 }
 }
 
 
 // Loads a window and binds the event handler for it.
 // Loads a window and binds the event handler for it.
-bool EventManager::LoadWindow(const Rocket::Core::String& window_name)
+Rocket::Core::ElementDocument* EventManager::LoadWindow(const Rocket::Core::String& window_name)
 {
 {
 	// Set the event handler for the new screen, if one has been registered.
 	// Set the event handler for the new screen, if one has been registered.
 	EventHandler* old_event_handler = event_handler;
 	EventHandler* old_event_handler = event_handler;
@@ -149,7 +149,7 @@ bool EventManager::LoadWindow(const Rocket::Core::String& window_name)
 	if (document == NULL)
 	if (document == NULL)
 	{
 	{
 		event_handler = old_event_handler;
 		event_handler = old_event_handler;
-		return false;
+		return nullptr;
 	}
 	}
 
 
 	// Set the element's title on the title; IDd 'title' in the RML.
 	// Set the element's title on the title; IDd 'title' in the RML.
@@ -163,5 +163,5 @@ bool EventManager::LoadWindow(const Rocket::Core::String& window_name)
 	// Remove the caller's reference.
 	// Remove the caller's reference.
 	document->RemoveReference();
 	document->RemoveReference();
 
 
-	return true;
+	return document;
 }
 }

+ 2 - 1
Samples/invaders/src/EventManager.h

@@ -29,6 +29,7 @@
 #define ROCKETINVADERSEVENTMANAGER_H
 #define ROCKETINVADERSEVENTMANAGER_H
 
 
 #include <Rocket/Core/Event.h>
 #include <Rocket/Core/Event.h>
+#include <Rocket/Core/ElementDocument.h>
 
 
 class EventHandler;
 class EventHandler;
 
 
@@ -53,7 +54,7 @@ public:
 	static void ProcessEvent(Rocket::Core::Event& event, const Rocket::Core::String& value);
 	static void ProcessEvent(Rocket::Core::Event& event, const Rocket::Core::String& value);
 	/// Loads a window and binds the event handler for it.
 	/// Loads a window and binds the event handler for it.
 	/// @param[in] window_name The name of the window to load.
 	/// @param[in] window_name The name of the window to load.
-	static bool LoadWindow(const Rocket::Core::String& window_name);
+	static Rocket::Core::ElementDocument* LoadWindow(const Rocket::Core::String& window_name);
 
 
 private:
 private:
 	EventManager();
 	EventManager();

+ 3 - 0
Source/Core/Element.cpp

@@ -2090,6 +2090,9 @@ void Element::DirtyOffset()
 {
 {
 	offset_dirty = true;
 	offset_dirty = true;
 
 
+	if(transform_state)
+		DirtyTransformState(true, true, false);
+
 	// Not strictly true ... ?
 	// Not strictly true ... ?
 	for (size_t i = 0; i < children.size(); i++)
 	for (size_t i = 0; i < children.size(); i++)
 		children[i]->DirtyOffset();
 		children[i]->DirtyOffset();

+ 0 - 1
Source/Core/TransformPrimitive.cpp

@@ -189,7 +189,6 @@ bool Rotate3D::ResolveTransform(Matrix4f& m, Element& e) const throw()
 
 
 bool SkewX::ResolveTransform(Matrix4f& m, Element& e) const throw()
 bool SkewX::ResolveTransform(Matrix4f& m, Element& e) const throw()
 {
 {
-	std::cout << "foo" << std::endl;
 	m = Matrix4f::SkewX(values[0]);
 	m = Matrix4f::SkewX(values[0]);
 	return true;
 	return true;
 }
 }