Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of git://github.com/monkstone/pembrokeshire_branch

  • Loading branch information...
commit af32c34380057d4e8598d0e054037e113fa76274 2 parents 3045a86 + 5b11a99
@jashkenas authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 context_free.rb
View
6 context_free.rb
@@ -11,8 +11,8 @@ class ContextFree
AVAILABLE_OPTIONS = [:x, :y, :rotation, :size, :flip, :color, :hue, :saturation, :brightness]
HSB_ORDER = {:hue => 0, :saturation => 1, :brightness => 2}
- Y_PLUS_TRIANGLE = (5 * (Math.sqrt(3)) - 4) / 8
- Y_MINUS_TRIANGLE = (Math.sqrt(3) - 4) / 8
+ Y_TRIANGLE_TOP = (4 - (5 * (Math.sqrt(3)))) / 8 # adjusted for processing coords
+ Y_TRIANGLE_BOTTOM = (4 - Math.sqrt(3)) / 8 # adjusted for processing coords
# Define a context-free system. Use this method to create a ContextFree
# object. Call render() on it to make it draw.
@@ -214,7 +214,7 @@ def circle(some_options=nil)
def triangle(some_options=nil)
size, options = *get_shape_values(some_options)
- @app.triangle(0, Y_PLUS_TRIANGLE * size, 0.5 * size, Y_MINUS_TRIANGLE * size, -0.5 * size, Y_MINUS_TRIANGLE * size)
+ @app.triangle(0, Y_TRIANGLE_TOP * size, 0.5 * size, Y_TRIANGLE_BOTTOM * size, -0.5 * size, Y_TRIANGLE_BOTTOM * size)
end
Please sign in to comment.
Something went wrong with that request. Please try again.