parent
9ceb010402
commit
8c4c0e0137
|
|
@ -14,6 +14,7 @@ Docs:
|
||||||
* svg: document rasterization on mask (#192)
|
* svg: document rasterization on mask (#192)
|
||||||
* Document how to run the code (#186)
|
* Document how to run the code (#186)
|
||||||
* Document some ways of using `prefix` in `save_png` (#268)
|
* Document some ways of using `prefix` in `save_png` (#268)
|
||||||
|
* `showcase` option `trim_radius` defaults to 38, not 0
|
||||||
|
|
||||||
Chores:
|
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
|
* Bumped deps: Pango et al. to 3.3.6, Cairo to 1.16.4, Nokogiri to 1.10.3, Highline to 2.0.2
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,15 @@ Renders a range of cards in a showcase as if they are sitting in 3D on a reflect
|
||||||
Options
|
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
|
scale
|
||||||
default: ``0.8``
|
default: ``0.8``
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,10 @@ module Squib
|
||||||
include DirValidator
|
include DirValidator
|
||||||
|
|
||||||
def self.parameters
|
def self.parameters
|
||||||
{ scale: 0.85,
|
{
|
||||||
|
scale: 0.85,
|
||||||
|
trim: 0,
|
||||||
|
trim_radius: 38,
|
||||||
offset: 1.1,
|
offset: 1.1,
|
||||||
reflect_offset: 15,
|
reflect_offset: 15,
|
||||||
reflect_percent: 0.25,
|
reflect_percent: 0.25,
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ module Squib
|
||||||
|
|
||||||
cards = range.collect { |i| @cards[i] }
|
cards = range.collect { |i| @cards[i] }
|
||||||
cards.each_with_index do |card, 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)
|
reflected = reflect(trimmed, showcase.reflect_offset, showcase.reflect_percent, showcase.reflect_strength)
|
||||||
perspectived = perspective(reflected, showcase.scale, showcase.face_right?)
|
perspectived = perspective(reflected, showcase.scale, showcase.face_right?)
|
||||||
out_cc.set_source(perspectived, sheet.margin + i * perspectived.width * showcase.offset, sheet.margin)
|
out_cc.set_source(perspectived, sheet.margin + i * perspectived.width * showcase.offset, sheet.margin)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue