Skip to content
Snippets Groups Projects
Commit c621fce1 authored by jtimotei's avatar jtimotei
Browse files

Tweak for improving checkbox location

parent 08aa8e0d
No related branches found
No related tags found
1 merge request!15Refactorings and compatibility fix
Pipeline #17773 passed with warnings
......@@ -319,7 +319,7 @@ class Exams extends React.Component {
return {
'widget': {
'x': {
$set: data.x + i * 24
$set: data.x + i * 23
},
'y': {
// each mc option needs to be positioned next to the previous option and should not overlap it
......
......@@ -232,8 +232,8 @@ class ExamEditor extends React.Component {
widget.problem.mc_options.forEach(
(option, i) => {
let newData = {
x: Math.round(data.x) + i * 24 + 6,
y: Math.round(data.y) + 11
x: Math.round(data.x) + i * 23 + 7,
y: Math.round(data.y) + 21
}
this.updateWidgetPositionDB(option, newData)
})
......
......@@ -173,14 +173,15 @@ def generate_checkbox(canvas, x, y, label):
margin = 5 # Margin between elements and sides
markboxsize = fontsize - 2 # Size of checkboxes boxes
x_label = x + 1 # location of the label
y_label = y - fontsize # remove fontsize from the y label since we draw from the bottom left up
y_label = y + margin # remove fontsize from the y label since we draw from the bottom left up
box_y = y - markboxsize
# check that there is a label to print
if (label and not (len(label) == 0)):
canvas.setFont('Helvetica', fontsize)
canvas.drawString(x_label, y_label, label[0])
box_y = box_y - margin - fontsize
#box_y = box_y - margin - fontsize
# canvas.lines([ (x, y, x +15, y), (x, y, x, y +15)])
canvas.rect(x, box_y, markboxsize, markboxsize)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment