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;
childSCWidgets = new Vector<Widget> (1, false);
DBG_OBJ_SET_NUM ("childSCWidgets.size", childSCWidgets->size());
DBG_OBJ_SET_NUM ("childSCWidgets.size", childSCWidgets.size());
numZIndices = 0;
zIndices = NULL;
@ -44,7 +43,6 @@ StackingContextMgr::StackingContextMgr (Widget *widget)
StackingContextMgr::~StackingContextMgr ()
{
delete childSCWidgets;
if (zIndices)
free (zIndices);
DBG_OBJ_DELETE ();
@ -76,9 +74,9 @@ void StackingContextMgr::addChildSCWidget (Widget *widget)
DBG_OBJ_ARRSET_NUM ("zIndex", pos, zIndices[pos]);
}
childSCWidgets->put (widget);
DBG_OBJ_SET_NUM ("childSCWidgets.size", childSCWidgets->size());
DBG_OBJ_ARRSET_PTR ("childSCWidgets", childSCWidgets->size() - 1, widget);
childSCWidgets.push_back (widget);
DBG_OBJ_SET_NUM ("childSCWidgets.size", childSCWidgets.size());
DBG_OBJ_ARRSET_PTR ("childSCWidgets", childSCWidgets.size() - 1, widget);
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_MSG_START ();
for (int i = 0; i < childSCWidgets->size (); i++) {
Widget *child = childSCWidgets->get (i);
for (std::size_t i = 0; i < childSCWidgets.size (); i++) {
Widget *child = childSCWidgets.at (i);
DBG_OBJ_MSGF ("draw", 2, "widget %p has zIndex = %d",
child, child->getStyle()->zIndex);
@ -172,9 +170,9 @@ Widget *StackingContextMgr::getWidgetAtPoint (int x, int y,
zIndices[zIndexIndex]);
DBG_OBJ_MSG_START ();
for (int i = childSCWidgets->size () - 1;
for (int i = (int)childSCWidgets.size () - 1;
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",
child, child->getStyle()->zIndex);
if (child->getStyle()->zIndex == zIndices[zIndexIndex])

View File

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