add ability to draw areas for radio options
This commit is contained in:
@@ -124,7 +124,13 @@ module Submissions
|
||||
layouter.fit(items, area['w'] * width, height_diff.positive? ? box_height : area['h'] * height)
|
||||
.draw(canvas, (area['x'] * width) + TEXT_LEFT_MARGIN,
|
||||
height - (area['y'] * height) + height_diff - TEXT_TOP_MARGIN)
|
||||
when 'checkbox'
|
||||
when ->(type) { type == 'checkbox' || (type.in?(%w[multiple radio]) && area['option_uuid'].present?) }
|
||||
if field['type'].in?(%w[multiple radio])
|
||||
option = field['options']&.find { |o| o['uuid'] == area['option_uuid'] }
|
||||
|
||||
value = Array.wrap(value).include?(option['value'])
|
||||
end
|
||||
|
||||
next unless value == true
|
||||
|
||||
scale = [(area['w'] * width) / PdfIcons::WIDTH, (area['h'] * height) / PdfIcons::HEIGHT].min
|
||||
|
||||
Reference in New Issue
Block a user