fix user avatar image sizing
This commit is contained in:
parent
6766e8ce74
commit
b77be1a9f4
7
bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/views/UserAvatar.as
Normal file → Executable file
7
bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/views/UserAvatar.as
Normal file → Executable file
@ -3,6 +3,8 @@ package org.bigbluebutton.modules.videoconf.views
|
||||
import flash.display.Loader;
|
||||
import flash.events.Event;
|
||||
import flash.net.URLRequest;
|
||||
|
||||
import mx.core.UIComponent;
|
||||
|
||||
public class UserAvatar extends UserGraphic {
|
||||
|
||||
@ -18,14 +20,17 @@ package org.bigbluebutton.modules.videoconf.views
|
||||
_completed = false;
|
||||
|
||||
_imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadingComplete);
|
||||
addChild(_imageLoader);
|
||||
|
||||
var request:URLRequest = new URLRequest(avatarUrl);
|
||||
_imageLoader.load(request);
|
||||
}
|
||||
|
||||
private function onLoadingComplete(event:Event):void {
|
||||
_completed = true;
|
||||
addChild(_imageLoader);
|
||||
setOriginalDimensions(_imageLoader.width, _imageLoader.height);
|
||||
if (parent && parent is UIComponent)
|
||||
UIComponent(parent).invalidateDisplayList();
|
||||
}
|
||||
|
||||
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
|
||||
|
@ -62,12 +62,12 @@ package org.bigbluebutton.modules.videoconf.views
|
||||
object_height = unscaledHeight;
|
||||
object_width = Math.ceil(unscaledHeight * aspectRatio);
|
||||
object_y = BORDER_THICKNESS;
|
||||
object_x = Math.floor((unscaledWidth - object.width) / 2);
|
||||
object_x = Math.floor((unscaledWidth - object_width) / 2);
|
||||
} else {
|
||||
object_width = unscaledWidth;
|
||||
object_height = Math.ceil(unscaledWidth / aspectRatio);
|
||||
object_x = BORDER_THICKNESS;
|
||||
object_y = Math.floor((unscaledHeight - object.height) / 2);
|
||||
object_y = Math.floor((unscaledHeight - object_height) / 2);
|
||||
}
|
||||
|
||||
object.x = object_x;
|
||||
|
Loading…
Reference in New Issue
Block a user