[haiku-bugs] [Haiku] #13584: BBitmap::ImportBits misses edge pixels

  • From: "Pete" <trac@xxxxxxxxxxxx>
  • Date: Mon, 03 Jul 2017 20:43:32 -0000

#13584: BBitmap::ImportBits misses edge pixels
--------------------------------+------------------------------
 Reporter:  Pete                |        Owner:  nobody
     Type:  bug                 |       Status:  new
 Priority:  normal              |    Milestone:  Unscheduled
Component:  Kits/Interface Kit  |      Version:  R1/Development
 Keywords:                      |   Blocked By:
 Blocking:                      |  Has a Patch:  0
 Platform:  All                 |
--------------------------------+------------------------------
 The ImportBits method misses the rightmost column, and bottommost row, of
 a source bitmap.  ArtPaint currently uses this to import all images into
 its display (loading a file, pasting a clip, etc.) and the result is
 always missing the right and bottom sets of pixels.  (Originally it did
 the operation itself explicitly, and that works.  For now, I've restored
 its original scheme.)

 For reference, here's the code it uses:

 {{{
                         fLayerData->ImportBits(bitmap, BPoint(B_ORIGIN),
 BPoint(B_ORIGIN),
                                 int32(min_c(frame.Width(),
 sourceRect.Width())),
                                 int32(min_c(frame.Height(),
 sourceRect.Height())));

 }}}
 (I guess enclosing B_ORIGIN in a BPoint is superfluous(!), but shouldn't
 affect things.)

--
Ticket URL: <https://dev.haiku-os.org/ticket/13584>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: