Another one bites the dust.

This commit is contained in:
2025-03-03 00:12:01 -05:00
parent df45103126
commit 82fcd7c1f8
2 changed files with 12 additions and 12 deletions

View File

@ -34,8 +34,7 @@ StackingContextMgr::StackingContextMgr (Widget *widget)
this->widget = widget; this->widget = widget;
childSCWidgets = new Vector<Widget> (1, false); DBG_OBJ_SET_NUM ("childSCWidgets.size", childSCWidgets.size());
DBG_OBJ_SET_NUM ("childSCWidgets.size", childSCWidgets->size());
numZIndices = 0; numZIndices = 0;
zIndices = NULL; zIndices = NULL;
@ -44,7 +43,6 @@ StackingContextMgr::StackingContextMgr (Widget *widget)
StackingContextMgr::~StackingContextMgr () StackingContextMgr::~StackingContextMgr ()
{ {
delete childSCWidgets;
if (zIndices) if (zIndices)
free (zIndices); free (zIndices);
DBG_OBJ_DELETE (); DBG_OBJ_DELETE ();
@ -76,9 +74,9 @@ void StackingContextMgr::addChildSCWidget (Widget *widget)
DBG_OBJ_ARRSET_NUM ("zIndex", pos, zIndices[pos]); DBG_OBJ_ARRSET_NUM ("zIndex", pos, zIndices[pos]);
} }
childSCWidgets->put (widget); childSCWidgets.push_back (widget);
DBG_OBJ_SET_NUM ("childSCWidgets.size", childSCWidgets->size()); DBG_OBJ_SET_NUM ("childSCWidgets.size", childSCWidgets.size());
DBG_OBJ_ARRSET_PTR ("childSCWidgets", childSCWidgets->size() - 1, widget); DBG_OBJ_ARRSET_PTR ("childSCWidgets", childSCWidgets.size() - 1, widget);
DBG_OBJ_LEAVE (); DBG_OBJ_LEAVE ();
} }
@ -135,8 +133,8 @@ void StackingContextMgr::draw (View *view, Rectangle *area, int startZIndex,
DBG_OBJ_MSGF ("draw", 1, "drawing zIndex = %d", zIndices[zIndexIndex]); DBG_OBJ_MSGF ("draw", 1, "drawing zIndex = %d", zIndices[zIndexIndex]);
DBG_OBJ_MSG_START (); DBG_OBJ_MSG_START ();
for (int i = 0; i < childSCWidgets->size (); i++) { for (std::size_t i = 0; i < childSCWidgets.size (); i++) {
Widget *child = childSCWidgets->get (i); Widget *child = childSCWidgets.at (i);
DBG_OBJ_MSGF ("draw", 2, "widget %p has zIndex = %d", DBG_OBJ_MSGF ("draw", 2, "widget %p has zIndex = %d",
child, child->getStyle()->zIndex); child, child->getStyle()->zIndex);
@ -172,9 +170,9 @@ Widget *StackingContextMgr::getWidgetAtPoint (int x, int y,
zIndices[zIndexIndex]); zIndices[zIndexIndex]);
DBG_OBJ_MSG_START (); DBG_OBJ_MSG_START ();
for (int i = childSCWidgets->size () - 1; for (int i = (int)childSCWidgets.size () - 1;
widgetAtPoint == NULL && i >= 0; i--) { widgetAtPoint == NULL && i >= 0; i--) {
Widget *child = childSCWidgets->get (i); Widget *child = childSCWidgets.at (i);
DBG_OBJ_MSGF ("events", 2, "widget %p has zIndex = %d", DBG_OBJ_MSGF ("events", 2, "widget %p has zIndex = %d",
child, child->getStyle()->zIndex); child, child->getStyle()->zIndex);
if (child->getStyle()->zIndex == zIndices[zIndexIndex]) if (child->getStyle()->zIndex == zIndices[zIndexIndex])

View File

@ -9,6 +9,8 @@
#include <limits.h> #include <limits.h>
#include <vector>
namespace dw { namespace dw {
namespace core { namespace core {
@ -20,7 +22,7 @@ class StackingContextMgr
{ {
private: private:
Widget *widget; Widget *widget;
lout::container::typed::Vector<Widget> *childSCWidgets; std::vector<Widget *> childSCWidgets;
int *zIndices, numZIndices; int *zIndices, numZIndices;
int findZIndex (int zIndex, bool mustExist); int findZIndex (int zIndex, bool mustExist);
@ -51,7 +53,7 @@ public:
void addChildSCWidget (Widget *widget); void addChildSCWidget (Widget *widget);
inline int getNumZIndices () { return numZIndices; } inline int getNumZIndices () { return numZIndices; }
inline int getNumChildSCWidgets () { return childSCWidgets->size (); } inline int getNumChildSCWidgets () { return childSCWidgets.size (); }
inline void drawBottom (View *view, Rectangle *area, DrawingContext *context) inline void drawBottom (View *view, Rectangle *area, DrawingContext *context)
{ draw (view, area, INT_MIN, -1, context); } { draw (view, area, INT_MIN, -1, context); }