Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,12 @@ static void adjustDisplay( GameWindow *window, Int adjustment,
}

child = list->slider->winGetChild();
if( child == NULL )
{
// Slider thumb button is missing - cannot adjust display properly
DEBUG_LOG(( "adjustDisplay: slider child is NULL, skipping slider adjustment" ));
return;
}
child->winGetSize( &sliderChildSize.x, &sliderChildSize.y );
sData->numTicks = (float)((sliderSize.y - sliderChildSize.y) / (float)sData->maxVal);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2349,6 +2349,15 @@ GameWindow *GameWindowManager::gogoGadgetSlider( GameWindow *parent,
button = gogoGadgetPushButton( slider, statusFlags, 0, 0,
width, width+1, &buttonInstData, NULL, TRUE );

// Check if button creation failed
if( button == NULL )
{
DEBUG_LOG(( "gogoGadgetSlider error: Failed to create slider thumb button" ));
// Clean up the slider window before returning
winDestroy( slider );
return NULL;
}

// Protect against divide by zero
if( sliderData->maxVal == sliderData->minVal )
sliderData->maxVal = sliderData->minVal + 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,12 @@ static void adjustDisplay( GameWindow *window, Int adjustment,
}

child = list->slider->winGetChild();
if( child == NULL )
{
// Slider thumb button is missing - cannot adjust display properly
DEBUG_LOG(( "adjustDisplay: slider child is NULL, skipping slider adjustment" ));
return;
}
child->winGetSize( &sliderChildSize.x, &sliderChildSize.y );
sData->numTicks = (float)((sliderSize.y - sliderChildSize.y) / (float)sData->maxVal);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2352,6 +2352,15 @@ GameWindow *GameWindowManager::gogoGadgetSlider( GameWindow *parent,
button = gogoGadgetPushButton( slider, statusFlags, 0, 0,
width, width+1, &buttonInstData, NULL, TRUE );

// Check if button creation failed
if( button == NULL )
{
DEBUG_LOG(( "gogoGadgetSlider error: Failed to create slider thumb button" ));
// Clean up the slider window before returning
winDestroy( slider );
return NULL;
}

// Protect against divide by zero
if( sliderData->maxVal == sliderData->minVal )
sliderData->maxVal = sliderData->minVal + 1;
Expand Down
Loading