mirror of
https://github.com/docusealco/docuseal
synced 2026-11-06 06:52:33 -05:00
add ability to draw areas for radio options
This commit is contained in:
1 parent
9aa68fe955
commit
333a5d6b7b
6 files changed
+138
-13
No files matched your search
@@ -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