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

 
 

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

Submitter:  Sudarshan S Chawathe <chaw>
Submitted:  Fri 28 Oct 2016 08:25:27 PM UTC
   
 
Category:  Scheme library Severity:  3 - Normal
Item Group:  Run-time exception Status:  Fixed
Privacy:  Public Assigned to:  bothner
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group administrator
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>
Group administrator
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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-10-30 bothner Open/ClosedOpen Closed
    2016-10-28 bothner StatusNone Fixed
        Assigned toNone bothner

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code