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:
Andy Meneely
2020-11-17 23:40:15 -05:00
parent 24c9fbd0bf
commit 93a0d56eda
20 changed files with 100 additions and 70 deletions
+3 -2
View File
@@ -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' }
+1 -1
View File
@@ -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