aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYingtong Li <runassudo@yingtongli.me>2017-03-22 17:50:25 +1100
committerYingtong Li <runassudo@yingtongli.me>2017-03-22 17:50:25 +1100
commitc70c2c88858cb8806c6a23d5f4ee3facaa08d553 (patch)
tree0b84e281d37988a12f1ec68fe1d62a022d9b6032
parent1e2cfa61e12a920055761eec599b8010b9aa8f3a (diff)
Fixes to drawing questions
Make colour available to initial question, fixes black lines Make lines partially transparent in admin view
-rw-r--r--pblive/__init__.py3
-rw-r--r--pblive/templates/question_draw_admin.html3
2 files changed, 4 insertions, 2 deletions
diff --git a/pblive/__init__.py b/pblive/__init__.py
index 71fba7f..7e93c70 100644
--- a/pblive/__init__.py
+++ b/pblive/__init__.py
@@ -110,7 +110,6 @@ def socket_disconnect():
@socketio.on('register')
def socket_register(colour_id, colour_name):
user = pblive.data.users[flask.request.sid]
- flask_socketio.emit('update', render_question(user, user.session, user.session.question_num), room=user.sid)
if not user.colour and (colour_id, colour_name) in user.session.colours:
user.colour = (colour_id, colour_name)
@@ -120,6 +119,8 @@ def socket_register(colour_id, colour_name):
for _, other_user in pblive.data.users.items():
if other_user != user and not other_user.colour and other_user.session == user.session:
flask_socketio.emit('update', flask.render_template('colour_picker.html', session=user.session), room=other_user.sid)
+
+ flask_socketio.emit('update', render_question(user, user.session, user.session.question_num), room=user.sid)
@socketio.on('answer')
def socket_answer(question_num, answer):
diff --git a/pblive/templates/question_draw_admin.html b/pblive/templates/question_draw_admin.html
index fcba0e8..c0a35b0 100644
--- a/pblive/templates/question_draw_admin.html
+++ b/pblive/templates/question_draw_admin.html
@@ -56,8 +56,8 @@
context.globalAlpha = 1;
context.drawImage(image, 0, 0, image.width * scale, image.height * scale);
- context.globalAlpha = 0.5;
if (userToShow === null) {
+ context.globalAlpha = 0.5;
for (var i = 0; i < images.length; i++) {
try {
var scale2 = image.height / images[i].height * scale;
@@ -67,6 +67,7 @@
}
}
} else {
+ context.globalAlpha = 0.8;
var i = users.indexOf(userToShow);
try {
var scale2 = image.height / images[i].height * scale;
Contact (issues, pull requests, etc.) at git@yingtongli.me. Generated by cgit.