×

Discussion Board

Results 1 to 1 of 1
  1. #1
    Registered User
    Join Date
    Mar 2009
    Location
    Gdansk, Poland
    Posts
    139

    Asha 501: bug with Graphics.drawRegion()

    1. Create a rectangular image (something clearly much longer than wider, the bug will not be visible with square images), lets say an image 100 px in height and 20 px in length.
    2. read it into a variable of type Image , lets say named 'testImg'
    2. try to display it at (10,200) rotated with

    Code:
    graphics.drawRegion(testImg,0,0,20,100,Sprite.TRANS_ROT270, 10, 200, Graphics.LEFT|Graphics.VCENTER );
    on all Symbians and Ashas <501, this will display a image 20 px high and 100 long , and VCENTERED around y=200. So the top left corner of the image will be at (10,200-testImg.getHeight()/2) = (10,190)

    On Asha 501 however, the image's top left corner will be at (10,150) !

    The bug only happens when one uses the VCENTER anchor, and not with TOP or BOTTOM.

    It's quite easy to see what happens: on Asha 501 the implementation of drawRegion , the top left corner is also at (10,200-testImg.getHeight()/2), but the getHeight() is computed before the rotation so we get (10,200-100/2) = (10,150).

    What is not so easy to see is why Nokia keeps rewriting such pieces of code, and apparently giving the job to interns, and then obviously does no unit tests?
    Last edited by Utumno; 2013-07-31 at 16:33.

Similar Threads

  1. Asha 311 issue with Graphics.copyArea?
    By TongMuan in forum Mobile Java Media (Graphics & Sounds)
    Replies: 14
    Last Post: 2013-08-05, 15:43
  2. Graphics.drawRegion versus setClip and translate
    By kruncher in forum Mobile Java Media (Graphics & Sounds)
    Replies: 4
    Last Post: 2009-11-21, 00:57
  3. Problem with drawRegion use
    By _Alexandr_ in forum Mobile Java General
    Replies: 0
    Last Post: 2006-03-12, 18:40
  4. DrawRegion.
    By smb101 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2003-09-27, 14:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •