bugKawa - Bugs: bug #49471, (kawa pictures) filling a...

 
 

bug #49471: (kawa pictures) filling a re-centered picture not OK?

Submitted by:  Sudarshan S Chawathe <chaw>
Submitted on:  Fri 28 Oct 2016 08:25:27 PM UTC  
 
Category: Scheme librarySeverity: 3 - Normal
Item Group: Run-time exceptionStatus: Fixed
Privacy: PublicAssigned to: Per Bothner <bothner>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 29 Oct 2016 09:25:17 AM UTC, comment #3:

Thanks! I just updated to SVN revision 8992M and can confirm that fill after re-center works.

Sudarshan S Chawathe <chaw>
Fri 28 Oct 2016 11:18:06 PM UTC, comment #2:

I fixed the NullPointerException.

I also tweaked re-center to it returns a shape if the argument was a shape. This was a 1-work fix.

Enjoy!

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Fri 28 Oct 2016 08:37:37 PM UTC, comment #1:

Well, it's not expected to work - though the NullPointerException is not good.

Basically, the re-center procedure returns a picture, but the fill procedure requires a shape, not picture. All shapes are pictures (or can be implicitly converted to pictures), but not vice versa.

It might be reasonable to tweak re-center so it returns a shape when the argument is a shape. This would be plausible, since re-center is essentially a 'translate', and the latter returns a shape when the argument is a shape.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Fri 28 Oct 2016 08:25:27 PM UTC, original submission:

I am unsure whether the problem here is me misinterpreting the documentation or a real problem, but the gist of it is that I seem to be missing something about what the re-center procedure does. (My assumption is that it returns a picture like the other nearby procedures.)

When I try to use fill on a re-centered picture, I get an exception. The following is an example, (using the SVN version of Kawa from October 23rd):

#|kawa:1|# (import (kawa pictures) (kawa swing))
#|kawa:2|# (define t (polygon &P[0 0] &P[-5 -5] &P[-5 5]))
#|kawa:3|# (show-picture t)
#|kawa:4|# (show-picture (fill t))
#|kawa:5|# (show-picture (re-center 'right 'origin t))
#|kawa:6|# (show-picture (fill (re-center 'right 'origin t)))
java.lang.NullPointerException
at gnu.mapping.WrappedException.<init>(WrappedException.java:40)
at gnu.mapping.WrongType.<init>(WrongType.java:55)
at gnu.expr.GenericProc.applyN(GenericProc.java:122)
at gnu.mapping.ProcedureN.apply1(ProcedureN.java:31)
at atInteractiveLevel-6.run(stdin:6)
at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:293)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:212)
at kawa.Shell.run(Shell.java:283)
at kawa.Shell.run(Shell.java:196)
at kawa.Shell.run(Shell.java:183)
at kawa.repl.processArgs(repl.java:705)
at kawa.repl.main(repl.java:811)
#|kawa:7|# (show-picture (re-center 'right 'origin (fill t)))
#|kawa:8|# (exit)
chaw@vereq:~$ kawa --version
Kawa 2.1.9 (revision 8992M)
Copyright (C) 2016 Per Bothner
chaw@vereq:~$

Sudarshan S Chawathe <chaw>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bothner (Posted a comment)
  • -unavailable- added by chaw (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 30 Oct 2016 01:18:07 AM UTCbothnerOpen/ClosedOpen=>Closed
    Fri 28 Oct 2016 11:18:06 PM UTCbothnerStatusNone=>Fixed
      Assigned toNone=>bothner

    Back to the top


    Powered by Savane 3.1-cleanup1