mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-12-02 19:22:58 +00:00
fixed: out of bounds exception when dragging rule editor slices
This commit is contained in:
1 parent
192b6ecfc4
commit
3d3674a7d8
1 file changed
+7
-1
@@ -2132,7 +2132,13 @@ TODO: implement
|
||||
return;
|
||||
|
||||
var point = [self convertPoint:[event locationInWindow] fromView:nil],
|
||||
view = [_slices objectAtIndex:FLOOR(MAX(0, point.y) / _sliceHeight)];
|
||||
index = FLOOR(MAX(0, point.y) / _sliceHeight);
|
||||
|
||||
// Check bounds before accessing the array to prevent CPRangeException
|
||||
if (index >= [_slices count])
|
||||
return;
|
||||
|
||||
var view = [_slices objectAtIndex:FLOOR(MAX(0, point.y) / _sliceHeight)];
|
||||
|
||||
if ([self _dragShouldBeginFromMouseDown:view])
|
||||
[self _performDragForSlice:view withEvent:event];
|
||||
|
||||
Reference in new issue
Block a user