👮 fix space after comma
This commit is contained in:
@@ -13,13 +13,13 @@ module Squib
|
||||
s.default_sheet = s.sheets[input.sheet[0]]
|
||||
data = {}
|
||||
s.first_column.upto(s.last_column) do |col|
|
||||
header = s.cell(s.first_row,col).to_s
|
||||
header = s.cell(s.first_row, col).to_s
|
||||
header.strip! if import.strip?
|
||||
data[header] = []
|
||||
(s.first_row + 1).upto(s.last_row) do |row|
|
||||
cell = s.cell(row,col)
|
||||
cell = s.cell(row, col)
|
||||
# Roo hack for avoiding unnecessary .0's on whole integers (https://github.com/roo-rb/roo/issues/139)
|
||||
cell = s.excelx_value(row,col) if s.excelx_type(row,col) == [:numeric_or_formula, 'General']
|
||||
cell = s.excelx_value(row, col) if s.excelx_type(row, col) == [:numeric_or_formula, 'General']
|
||||
cell.strip! if cell.respond_to?(:strip) && import.strip?
|
||||
cell = yield(header, cell) if block_given?
|
||||
data[header] << cell
|
||||
|
||||
@@ -87,7 +87,7 @@ module Squib
|
||||
new_val = val.map.with_index{ |v, i| send(method, v, i) }
|
||||
instance_variable_set(attribute, new_val)
|
||||
else
|
||||
instance_variable_set(attribute,send(method, val))
|
||||
instance_variable_set(attribute, send(method, val))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -13,7 +13,7 @@ module Squib
|
||||
@progress_bar.start("Saving PDF to #{file}", range.size) do |bar|
|
||||
range.each do |i|
|
||||
card = @cards[i]
|
||||
cc.translate(x,y)
|
||||
cc.translate(x, y)
|
||||
cc.rectangle(sheet.trim, sheet.trim, card_width, card_height)
|
||||
cc.clip
|
||||
case card.backend.downcase.to_sym
|
||||
@@ -23,7 +23,7 @@ module Squib
|
||||
when :svg
|
||||
card.cairo_surface.finish
|
||||
cc.save
|
||||
cc.scale(0.8,0.8) # I really don't know why I needed to do this at all. But 0.8 is the magic number to get this to scale right
|
||||
cc.scale(0.8, 0.8) # I really don't know why I needed to do this at all. But 0.8 is the magic number to get this to scale right
|
||||
cc.render_rsvg_handle(RSVG::Handle.new_from_file(card.svgfile), nil)
|
||||
cc.restore
|
||||
else
|
||||
@@ -31,14 +31,14 @@ module Squib
|
||||
end
|
||||
bar.increment
|
||||
cc.reset_clip
|
||||
cc.translate(-x,-y)
|
||||
cc.translate(-x, -y)
|
||||
x += card.width + sheet.gap - 2*sheet.trim
|
||||
if x > (sheet.width - card_width - sheet.margin)
|
||||
x = sheet.margin
|
||||
y += card.height + sheet.gap - 2*sheet.trim
|
||||
if y > (sheet.height - card_height - sheet.margin)
|
||||
cc.show_page # next page
|
||||
x,y = sheet.margin,sheet.margin
|
||||
x, y = sheet.margin, sheet.margin
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -92,7 +92,7 @@ module Squib
|
||||
if trim > 0
|
||||
tmp = Cairo::ImageSurface.new(width-2*trim, height-2*trim)
|
||||
cc = Cairo::Context.new(tmp)
|
||||
cc.set_source(surface,-1*trim, -1*trim)
|
||||
cc.set_source(surface, -1*trim, -1*trim)
|
||||
cc.paint
|
||||
surface = tmp
|
||||
end
|
||||
|
||||
@@ -52,9 +52,9 @@ module Squib
|
||||
tmp_cc.transform(matrix) # flips the coordinate system
|
||||
top_y = src.height # top of the reflection
|
||||
bottom_y = src.height * (1.0 - rpercent) + roffset # bottom of the reflection
|
||||
gradient = Cairo::LinearPattern.new(0,top_y, 0,bottom_y)
|
||||
gradient.add_color_stop_rgba(0.0, 0,0,0, rstrength) # start a little reflected
|
||||
gradient.add_color_stop_rgba(1.0, 0,0,0, 0.0) # fade to nothing
|
||||
gradient = Cairo::LinearPattern.new(0, top_y, 0, bottom_y)
|
||||
gradient.add_color_stop_rgba(0.0, 0, 0, 0, rstrength) # start a little reflected
|
||||
gradient.add_color_stop_rgba(1.0, 0, 0, 0, 0.0) # fade to nothing
|
||||
tmp_cc.set_source(src, 0, 0)
|
||||
tmp_cc.mask(gradient)
|
||||
return tmp_cc.target
|
||||
@@ -74,7 +74,7 @@ module Squib
|
||||
dest_cxt.translate 0, src.height / 2.0 * (1.0 - factor)
|
||||
dest_cxt.scale factor * scale, factor
|
||||
dest_cxt.set_source src, 0, 0
|
||||
dest_cxt.rounded_rectangle i, 0, out_thickness, src.height, 0,0
|
||||
dest_cxt.rounded_rectangle i, 0, out_thickness, src.height, 0, 0
|
||||
dest_cxt.fill
|
||||
dest_cxt.restore
|
||||
end
|
||||
|
||||
@@ -43,9 +43,9 @@ module Squib
|
||||
parent_keys.each do |parent_key|
|
||||
from_extends = yml[key].merge(recurse_extends(yml, parent_key, visited)) do |key, child_val, parent_val|
|
||||
if child_val.to_s.strip.start_with?('+=')
|
||||
parent_val + child_val.sub('+=','').strip.to_f
|
||||
parent_val + child_val.sub('+=', '').strip.to_f
|
||||
elsif child_val.to_s.strip.start_with?('-=')
|
||||
parent_val - child_val.sub('-=','').strip.to_f
|
||||
parent_val - child_val.sub('-=', '').strip.to_f
|
||||
else
|
||||
child_val #child overrides parent when merging, no +=
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user