Ordering of Rotating and Coloring ThickArc matters

9 views
Skip to first unread message

Ruben Pieters

unread,
Oct 27, 2019, 3:10:59 AM10/27/19
to Haskell Gloss
If I display a ThickArc and rotate/color it, then the ordering of rotating and coloring seems to matter in some circumstances. I don't think this is intended behavior?

Reproduction code:

module Main where

import Data.Function ((&))

import Graphics.Gloss

pic1
= ThickArc 0 300 20 5

pic2
= ThickArc 0 300 20 5 & Color red & Rotate 90

pic3
= ThickArc 0 300 20 5 & Rotate 90 & Color red

main
:: IO ()
main
= let
  bgColor
= makeColor 1 1 1 1
 
in play (InWindow "bug" (100, 100) (100, 100)) bgColor 60 () (\_ -> pic1) (\_ w -> w) (\_ w -> w)

pic1 gives me: an arc from 0 to 300 degrees

pic2 (color then rotate) gives me: which is what I expect, the arc from 0 to 300 degrees rotated 90 degrees
pic3 (rotate then color), however, gives me: which seems to be the arc from 300 to 0 degrees rotated 90 degrees, not what I expected

Ben Lippmeier

unread,
Oct 29, 2019, 9:00:54 PM10/29/19
to haskel...@googlegroups.com, Ruben Pieters
Thanks, this will be due to a misguided optimisation in the renderer which is easy to turn off. I should be able to look at it over the weekend.

Ben.


On 25 Oct 2019, at 10:44 pm, Ruben Pieters <rubenpiet...@gmail.com> wrote:

If I display a ThickArc and rotate/color it, then the ordering of rotating and coloring seems to matter in some circumstances. I don't think this is intended behavior?

Reproduction code:

module Main where

import Data.Function ((&))

import Graphics.Gloss

pic1
= ThickArc 0 300 20 5

pic2
= ThickArc 0 300 20 5 & Color red & Rotate 90

pic3
= ThickArc 0 300 20 5 & Rotate 90 & Color red

main
:: IO ()
main
= let
  bgColor
= makeColor 1 1 1 1
 
in play (InWindow "bug" (100, 100) (100, 100)) bgColor 60 () (\_ -> pic1) (\_ w -> w) (\_ w -> w)

pic1 gives me:<Auto Generated Inline Image 1.png> an arc from 0 to 300 degrees

pic2 (color then rotate) gives me: <Auto Generated Inline Image 2.png> which is what I expect, the arc from 0 to 300 degrees rotated 90 degrees
pic3 (rotate then color), however, gives me: <Auto Generated Inline Image 3.png> which seems to be the arc from 300 to 0 degrees rotated 90 degrees, not what I expected

--
You received this message because you are subscribed to the Google Groups "Haskell Gloss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haskell-glos...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/haskell-gloss/7746d2df-6886-46d5-98e6-979d717d3113%40googlegroups.com.
<Auto Generated Inline Image 1.png><Auto Generated Inline Image 2.png><Auto Generated Inline Image 3.png>

Reply all
Reply to author
Forward
0 new messages