From 55421ba9124fbe12f1212f9d66db4548b76f23c0 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Wed, 14 Feb 2018 14:46:19 +0100 Subject: [PATCH] Unique avatars: fix position for bigger avatars --- app/assets/javascripts/app/models/user.coffee | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/app/models/user.coffee b/app/assets/javascripts/app/models/user.coffee index b55d9c695..c07a29e6d 100644 --- a/app/assets/javascripts/app/models/user.coffee +++ b/app/assets/javascripts/app/models/user.coffee @@ -86,20 +86,20 @@ class App.User extends App.Model # generate uniq avatar if !@image || @image is 'none' || unique - width = 300 - height = 226 + width = 300 * size/baseSize + height = 226 * size/baseSize rng = new Math.seedrandom(@id) - x = rng() * (width - size) - y = rng() * (height - size) + x = 0.5 * (width - size) + y = 0.5 * (height - size) return App.view('avatar_unique') data: data cssClass: cssClass placement: placement vip: vip - x: x * size/baseSize - y: y * size/baseSize + x: x + y: y initials: @initials() # generate image based avatar