* _GetCharacterAt() might actually fail - this fixes a bug causing the bitmap
initialization to fail. This also caused a crash, as that wasn't checked for before. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33729 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -303,12 +303,17 @@ CharacterView::MouseMoved(BPoint where, uint32 transit,
|
|||||||
|
|
||||||
// Update character - we want to drag the one we originally clicked
|
// Update character - we want to drag the one we originally clicked
|
||||||
// on, not the one the mouse might be over now.
|
// on, not the one the mouse might be over now.
|
||||||
_GetCharacterAt(fClickPoint, character, &frame);
|
if (!_GetCharacterAt(fClickPoint, character, &frame))
|
||||||
|
return;
|
||||||
|
|
||||||
BPoint offset = fClickPoint - frame.LeftTop();
|
BPoint offset = fClickPoint - frame.LeftTop();
|
||||||
frame.OffsetTo(B_ORIGIN);
|
frame.OffsetTo(B_ORIGIN);
|
||||||
|
|
||||||
BBitmap* bitmap = new BBitmap(frame, B_BITMAP_ACCEPTS_VIEWS, B_RGBA32);
|
BBitmap* bitmap = new BBitmap(frame, B_BITMAP_ACCEPTS_VIEWS, B_RGBA32);
|
||||||
|
if (bitmap->InitCheck() != B_OK) {
|
||||||
|
delete bitmap;
|
||||||
|
return;
|
||||||
|
}
|
||||||
bitmap->Lock();
|
bitmap->Lock();
|
||||||
|
|
||||||
BView* view = new BView(frame, "drag", 0, 0);
|
BView* view = new BView(frame, "drag", 0, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user