From 50186717bc9fc90ceda1cfab7e08a01ee1290586 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Sun, 24 Mar 2019 10:51:01 +0000
Subject: [PATCH] The draw() and draw_bin() methods now support an additional,
 optional 'top' argument which specifies that the avatar should be drawn at
 the top of the screen.

---
 exec/load/avatar_lib.js | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/exec/load/avatar_lib.js b/exec/load/avatar_lib.js
index da99af7e9a..b687d4476f 100644
--- a/exec/load/avatar_lib.js
+++ b/exec/load/avatar_lib.js
@@ -265,15 +265,15 @@ function is_enabled(obj)
 }
 
 // Uses Graphic.draw() at an absolute screen coordinate
-function draw(usernum, username, netaddr, above, right)
+function draw(usernum, username, netaddr, above, right, top)
 {
 	var avatar = this.read(usernum, username, netaddr);
 	if(!is_enabled(avatar))
 		return false;
-	return draw_bin(avatar.data, above, right);
+	return draw_bin(avatar.data, above, right, top);
 }
 
-function draw_bin(data, above, right)
+function draw_bin(data, above, right, top)
 {
 	load('graphic.js');
 	var graphic = new Graphic(this.defs.width, this.defs.height);
@@ -283,7 +283,9 @@ function draw_bin(data, above, right)
 		var pos = console.getxy();
 		var x = pos.x;
 		var y = pos.y;
-		if(above)
+		if(top)
+			y = 1;
+		else if(above)
 			y -= this.defs.height;
 		if(right)
 			x = console.screen_columns - (this.defs.width + 1);
-- 
GitLab