Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#6070 closed bug (fixed)

DrawPicture ignores offset (where)

Reported by: laplace Owned by: axeld
Priority: normal Milestone: R1
Component: Servers/app_server Version: R1/alpha2
Keywords: Cc:
Blocked By: Blocking: #6008
Has a Patch: yes Platform: All

Description

BView::DrawPicture(BPicture* picture, BPoint where) allways draws the picture at offset (0, 0).

To reproduce run FlattenPictureTest application from src/tests/kits/interface/flatten_picture. Choose from menu Tests > Run. The test case with name "Test Record and Play Picture with Offset" fails. In this test case a picture containing a black fillled rectangle is recorded into a BPicture and then drawn two times at first at point (10, 10) and then at (0, 0). The rectangle at (10, 10) is drawn at (0, 0) too (or not at all, the test case does not reveal that, but it is unlikely).

Attachments (1)

patch.diff (575 bytes) - added by jackburton 9 years ago.
BPicture offset fix

Download all attachments as: .zip

Change History (11)

comment:1 Changed 9 years ago by laplace

Blocking: 6008 added

(In #6008) Drawing a BPicture ignores the offset currently (see ticket #6070).

comment:2 Changed 9 years ago by jackburton

I guess this is a regression, I remember having implemented this long ago.

comment:3 Changed 9 years ago by jackburton

I'd look at hrev27214 (where I fixed the problem), hrev35472 and hrev35905, for a start.

Changed 9 years ago by jackburton

Attachment: patch.diff added

BPicture offset fix

comment:4 Changed 9 years ago by jackburton

Has a Patch: set

comment:5 Changed 9 years ago by jackburton

The patch fixes the problem. I don't have access to svn right now (and won't have for a while). Please someone apply.

comment:6 Changed 9 years ago by stippi

Resolution: fixed
Status: newclosed

Makes a lot of sense, applied in hrev36933. Thanks! Did you find out the revision where this was broken by any chance?

comment:7 Changed 9 years ago by jackburton

looks like hrev33876 was the culprit.

comment:8 Changed 9 years ago by stippi

Ah yes, now I see it. Two lessons: 1) Leave comments when you do seemingly weird things (although I am not sure this qualifies...) and 2) Always proof-read Axel's commits, hehe.

comment:9 in reply to:  5 Changed 9 years ago by laplace

Replying to jackburton:

The patch fixes the problem. I don't have access to svn right now (and won't have for a while). Please someone apply.

Thank you that fixes the problem.

comment:10 in reply to:  8 Changed 9 years ago by axeld

Replying to stippi:

Ah yes, now I see it. Two lessons: 1) Leave comments when you do seemingly weird things (although I am not sure this qualifies...)

A comment would have been nice, but thinking twice would probably have helped as well in this case. At least that's how long it took me this time until I understand why it was indeed needed ;-)

and 2) Always proof-read Axel's commits, hehe.

Yes, please! Sorry for the regression, anyway.

Note: See TracTickets for help on using tickets.