Browse Source

showcase: trim_radius still defaults to 38px

docs reflect that now too
dev
Andy Meneely 7 years ago
parent
commit
8c4c0e0137
  1. 1
      CHANGELOG.md
  2. 10
      docs/dsl/showcase.rst
  3. 5
      lib/squib/args/showcase_special.rb
  4. 2
      lib/squib/graphics/showcase.rb

1
CHANGELOG.md

@ -14,6 +14,7 @@ Docs:
* svg: document rasterization on mask (#192)
* Document how to run the code (#186)
* Document some ways of using `prefix` in `save_png` (#268)
* `showcase` option `trim_radius` defaults to 38, not 0
Chores:
* Bumped deps: Pango et al. to 3.3.6, Cairo to 1.16.4, Nokogiri to 1.10.3, Highline to 2.0.2

10
docs/dsl/showcase.rst

@ -6,7 +6,15 @@ Renders a range of cards in a showcase as if they are sitting in 3D on a reflect
Options
-------
.. include:: /args/trim.rst
trim
default: ``0``
the margin around the card to trim before putting into the image
trim_radius
default: ``38``
the rounded rectangle radius around the card to trim before putting into the image. Defaults to 1/8in rounded corners (38px).
scale
default: ``0.8``

5
lib/squib/args/showcase_special.rb

@ -11,7 +11,10 @@ module Squib
include DirValidator
def self.parameters
{ scale: 0.85,
{
scale: 0.85,
trim: 0,
trim_radius: 38,
offset: 1.1,
reflect_offset: 15,
reflect_percent: 0.25,

2
lib/squib/graphics/showcase.rb

@ -21,7 +21,7 @@ module Squib
cards = range.collect { |i| @cards[i] }
cards.each_with_index do |card, i|
trimmed = trim_rounded(card.cairo_surface, sheet.trim, sheet.trim_radius)
trimmed = trim_rounded(card.cairo_surface, showcase.trim, showcase.trim_radius)
reflected = reflect(trimmed, showcase.reflect_offset, showcase.reflect_percent, showcase.reflect_strength)
perspectived = perspective(reflected, showcase.scale, showcase.face_right?)
out_cc.set_source(perspectived, sheet.margin + i * perspectived.width * showcase.offset, sheet.margin)

Loading…
Cancel
Save