From d845c4d48614fb57302054914d722850e4290bf8 Mon Sep 17 00:00:00 2001 From: Scott Davis Date: Sat, 16 Apr 2011 22:09:42 -0400 Subject: [PATCH] gradient rounding issue tentative fix --- Gemfile.lock | 2 +- lib/compass/sass_extensions/functions/gradient_support.rb | 3 ++- test/fixtures/stylesheets/compass/sass/grid_background.scss | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0dc7c833..af65ce14 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,7 +7,7 @@ GIT PATH remote: . specs: - compass (0.11.beta.6.bc4e3ee) + compass (0.11.beta.7.86788e5) chunky_png (~> 1.1.0) sass (>= 3.1.0.alpha.249) diff --git a/lib/compass/sass_extensions/functions/gradient_support.rb b/lib/compass/sass_extensions/functions/gradient_support.rb index 96ce26a9..0e901462 100644 --- a/lib/compass/sass_extensions/functions/gradient_support.rb +++ b/lib/compass/sass_extensions/functions/gradient_support.rb @@ -1,3 +1,4 @@ +require 'bigdecimal' module Compass::SassExtensions::Functions::GradientSupport GRADIENT_ASPECTS = %w(webkit moz svg pie css2 o owg).freeze @@ -289,7 +290,7 @@ module Compass::SassExtensions::Functions::GradientSupport stop = pos.stop stop = stop.div(max).times(Sass::Script::Number.new(100,["%"])) if stop.numerator_units == max.numerator_units && max.numerator_units != ["%"] # Make sure the color stops are specified in the right order. - if last_value && stop.numerator_units == last_value.numerator_units && stop.denominator_units == last_value.denominator_units && stop.value < last_value.value + if last_value && stop.numerator_units == last_value.numerator_units && stop.denominator_units == last_value.denominator_units && BigDecimal.new(stop.value.to_s) < BigDecimal.new(last_value.value.to_s) raise Sass::SyntaxError.new("Color stops must be specified in increasing order. #{stop.value} came after #{last_value.value}.") end last_value = stop diff --git a/test/fixtures/stylesheets/compass/sass/grid_background.scss b/test/fixtures/stylesheets/compass/sass/grid_background.scss index 58e5230a..4f50ed4a 100644 --- a/test/fixtures/stylesheets/compass/sass/grid_background.scss +++ b/test/fixtures/stylesheets/compass/sass/grid_background.scss @@ -28,3 +28,7 @@ $grid-background-gutter-width: 1%; .percent-combined { @include grid-background; } + +.forced-fluid { + @include column-grid-background(12, 2em, 1em, 1em, $grid-background-column-color, $grid-background-gutter-color, true); +} \ No newline at end of file