* _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:
Axel Dörfler
2009-10-22 14:00:17 +00:00
parent e8885f2097
commit 48c06f4214
+6 -1
View File
@@ -303,12 +303,17 @@ CharacterView::MouseMoved(BPoint where, uint32 transit,
// Update character - we want to drag the one we originally clicked
// 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();
frame.OffsetTo(B_ORIGIN);
BBitmap* bitmap = new BBitmap(frame, B_BITMAP_ACCEPTS_VIEWS, B_RGBA32);
if (bitmap->InitCheck() != B_OK) {
delete bitmap;
return;
}
bitmap->Lock();
BView* view = new BView(frame, "drag", 0, 0);