woof this was a big change but ok
Add cell_px everywhere we have dpi This might be smelly. Sorry, Mr. Fowler and Prof. Frens...
This commit is contained in:
@@ -55,7 +55,8 @@ describe Squib::Args::Box do
|
||||
|
||||
context 'layouts' do
|
||||
let(:deck_of_2) do
|
||||
OpenStruct.new(width: 123, height: 456, size: 2, layout: {
|
||||
OpenStruct.new(width: 123, height: 456, size: 2,
|
||||
dpi: 300, cell_px: 37.5, layout: {
|
||||
'attack' => { 'x' => 50 },
|
||||
'defend' => { 'x' => 60 },
|
||||
})
|
||||
@@ -100,7 +101,7 @@ describe Squib::Args::Box do
|
||||
end
|
||||
|
||||
context 'unit conversion' do
|
||||
let(:deck_of_2) { OpenStruct.new(width: 123, height: 456, size: 2, dpi: 300) }
|
||||
let(:deck_of_2) { OpenStruct.new(width: 123, height: 456, size: 2, dpi: 300, cell_px: 37.5) }
|
||||
|
||||
it 'converts units on all args' do
|
||||
args = { x: ['1in', '2in'], y: 300, width: '1in', height: '1in' }
|
||||
|
||||
@@ -50,7 +50,7 @@ describe Squib::Args::Draw do
|
||||
|
||||
it 'does unit conversion on dash options' do
|
||||
args = { dash: '3in 4in 5in' }
|
||||
draw.load!(args)
|
||||
draw.load!(args, dpi: 300)
|
||||
expect(draw).to have_attributes(dash: [[900, 1200, 1500]])
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user