[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/character.cpp server/cha...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/character.cpp server/cha... |
Date: |
Tue, 28 Nov 2006 16:20:27 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 06/11/28 16:20:27
Modified files:
. : ChangeLog
server : character.cpp character.h
server/vm : ASHandlers.cpp
Log message:
* server/character.cpp (do_mouse_drag): indentation
* server/character.h (drag_state): documented
coordinate space for drag bounds.
* server/vm/ASHandlers.cpp (ActionStartDragMovie):
convert pixels to twips when reading drag boundaries.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1804&r2=1.1805
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.cpp?cvsroot=gnash&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.h?cvsroot=gnash&r1=1.30&r2=1.31
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.4&r2=1.5
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1804
retrieving revision 1.1805
diff -u -b -r1.1804 -r1.1805
--- ChangeLog 28 Nov 2006 15:59:30 -0000 1.1804
+++ ChangeLog 28 Nov 2006 16:20:27 -0000 1.1805
@@ -1,5 +1,13 @@
2006-11-28 Sandro Santilli <address@hidden>
+ * server/character.cpp (do_mouse_drag): indentation
+ * server/character.h (drag_state): documented
+ coordinate space for drag bounds.
+ * server/vm/ASHandlers.cpp (ActionStartDragMovie):
+ convert pixels to twips when reading drag boundaries.
+
+2006-11-28 Sandro Santilli <address@hidden>
+
* server/button_character_instance.{cpp,h}:
Don't override get_mouse_state with an equivalent
implementation.
Index: server/character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/character.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- server/character.cpp 28 Nov 2006 15:59:30 -0000 1.11
+++ server/character.cpp 28 Nov 2006 16:20:27 -0000 1.12
@@ -18,7 +18,7 @@
//
//
-/* $Id: character.cpp,v 1.11 2006/11/28 15:59:30 strk Exp $ */
+/* $Id: character.cpp,v 1.12 2006/11/28 16:20:27 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -44,9 +44,9 @@
point world_mouse(PIXELS_TO_TWIPS(x), PIXELS_TO_TWIPS(y));
if ( st.hasBounds() )
{
- const rect& bounds = st.getBounds();
// Clamp mouse coords within a defined rect.
- bounds.clamp(world_mouse);
+ // (it is assumed that drag_state keeps
+ st.getBounds().clamp(world_mouse);
}
if (st.isLockCentered())
@@ -74,6 +74,12 @@
else
{
// Implement relative drag...
+ static bool warned_relative_drag = false;
+ if ( ! warned_relative_drag )
+ {
+ log_warning("FIXME: Relative drag unsupported");
+ warned_relative_drag = true;
+ }
}
}
}
Index: server/character.h
===================================================================
RCS file: /sources/gnash/gnash/server/character.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- server/character.h 28 Nov 2006 15:59:30 -0000 1.30
+++ server/character.h 28 Nov 2006 16:20:27 -0000 1.31
@@ -18,7 +18,7 @@
//
//
-/* $Id: character.h,v 1.30 2006/11/28 15:59:30 strk Exp $ */
+/* $Id: character.h,v 1.31 2006/11/28 16:20:27 strk Exp $ */
#ifndef GNASH_CHARACTER_H
#define GNASH_CHARACTER_H
@@ -66,6 +66,8 @@
bool _hasbounds;
+ /// Boundaries to constraint the drag into.
+ /// Coordinates in TWIPS.
rect _bounds;
boost::intrusive_ptr<character> _character;
@@ -86,11 +88,28 @@
return _hasbounds;
}
+ /// \brief
+ /// Get the boundaries to constraint
+ /// the drag into.
+ //
+ /// Coordinates of the rectangle are
+ /// expected in TWIPS.
+ ///
+ /// Note that if hasBounds() is false
+ /// the returned rectangle is the NULL
+ /// rectangle - see rect::is_null().
+ ///
const rect& getBounds() const {
return _bounds;
}
- // Initialize the boundaries
+ /// \brief
+ /// Set the boundaries to constraint
+ /// the drag into.
+ //
+ /// Coordinates of the rectangle are
+ /// expected in TWIPS.
+ ///
void setBounds(const rect& bounds) {
_bounds = bounds;
_hasbounds = true;
Index: server/vm/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- server/vm/ASHandlers.cpp 28 Nov 2006 15:59:30 -0000 1.4
+++ server/vm/ASHandlers.cpp 28 Nov 2006 16:20:27 -0000 1.5
@@ -16,7 +16,7 @@
//
-/* $Id: ASHandlers.cpp,v 1.4 2006/11/28 15:59:30 strk Exp $ */
+/* $Id: ASHandlers.cpp,v 1.5 2006/11/28 16:20:27 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -42,6 +42,7 @@
#include "Object.h"
#include "gstring.h" // for automatic as_value::STRING => String as object
#include "Number.h" // for automatic as_value::NUMBER => Number as object
+#include "types.h" // for PIXELS_TO_TWIPS
#include <string>
#include <map>
@@ -1255,10 +1256,10 @@
// we must remember to updated this as required
ensure_stack(env, 7); // original 3 + 4 for bound
- float y1 = env.top(3).to_number();
- float x1 = env.top(4).to_number();
- float y0 = env.top(5).to_number();
- float x0 = env.top(6).to_number();
+ float y1 = PIXELS_TO_TWIPS(env.top(3).to_number());
+ float x1 = PIXELS_TO_TWIPS(env.top(4).to_number());
+ float y0 = PIXELS_TO_TWIPS(env.top(5).to_number());
+ float x0 = PIXELS_TO_TWIPS(env.top(6).to_number());
// check for swapped values
if ( y1 < y0 )
@@ -1277,6 +1278,10 @@
swap(x1, x0);
}
+ // It looks like coordinates of drag bounds are
+ // given as PIXELS :
+ // http://www.richsalter.btinternet.co.uk/cks1/cks1.swf
+
rect bounds(x0, y0, x1, y1);
st.setBounds(bounds);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/character.cpp server/cha...,
Sandro Santilli <=