[python-tahrir] Offset badge models to be centered.

Ralph Bean ralph at fedoraproject.org
Mon Jul 14 19:39:31 UTC 2014


commit e0a7d6cada7db31697d2a6ac06774fd38faf0c93
Author: Ralph Bean <rbean at redhat.com>
Date:   Mon Jul 14 15:39:38 2014 -0400

    Offset badge models to be centered.

 python-tahrir-offset.patch |   33 +++++++++++++++++++++++++++++++++
 python-tahrir.spec         |    8 +++++++-
 2 files changed, 40 insertions(+), 1 deletions(-)
---
diff --git a/python-tahrir-offset.patch b/python-tahrir-offset.patch
new file mode 100644
index 0000000..e102aa2
--- /dev/null
+++ b/python-tahrir-offset.patch
@@ -0,0 +1,33 @@
+From 824da05f3f6d14ba8491e721019f483666dcab43 Mon Sep 17 00:00:00 2001
+From: Ralph Bean <rbean at redhat.com>
+Date: Mon, 14 Jul 2014 15:36:17 -0400
+Subject: [PATCH] Offset our badges by 25 units.
+
+---
+ tahrir/static/js/thingiview/thingiview.js | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/tahrir/static/js/thingiview/thingiview.js b/tahrir/static/js/thingiview/thingiview.js
+index 71511eb..faccd80 100644
+--- a/tahrir/static/js/thingiview/thingiview.js
++++ b/tahrir/static/js/thingiview/thingiview.js
+@@ -752,6 +752,7 @@ var STLGeometry = function(stlArray) {
+ 
+ 	var scope = this;
+ 
++  var offset = -25;
+   // var vertexes = stlArray[0];
+   // var normals  = stlArray[1];
+   // var faces    = stlArray[2];
+@@ -766,7 +767,7 @@ var STLGeometry = function(stlArray) {
+ 
+   function v(x, y, z) {
+     // log("adding vertex: " + x + "," + y + "," + z);
+-    scope.vertices.push( new THREE.Vertex( new THREE.Vector3( x, y, z ) ) );
++    scope.vertices.push( new THREE.Vertex( new THREE.Vector3( x + offset, y + offset, z ) ) );
+   }
+ 
+   function f3(a, b, c) {
+-- 
+1.9.3
+
diff --git a/python-tahrir.spec b/python-tahrir.spec
index d306826..e9da3a0 100644
--- a/python-tahrir.spec
+++ b/python-tahrir.spec
@@ -2,13 +2,14 @@
 
 Name:             python-tahrir
 Version:          0.7.0
-Release:          1%{?dist}
+Release:          2%{?dist}
 Summary:          A pyramid app for issuing your own Open Badges
 
 Group:            Development/Languages
 License:          AGPLv3+
 URL:              http://pypi.python.org/pypi/%{modname}
 Source0:          http://pypi.python.org/packages/source/t/tahrir/%{modname}-%{version}.tar.gz
+Patch0:           python-tahrir-offset.patch
 
 BuildArch:        noarch
 
@@ -53,6 +54,8 @@ https://wiki.mozilla.org/Badges
 %prep
 %setup -q -n %{modname}-%{version}
 
+%patch0 -p1
+
 # Make sure that epel/rhel picks up the correct version of sqlalchemy
 %{__awk} 'NR==1{print "import __main__; __main__.__requires__ = __requires__ = [\"sqlalchemy>=0.7\"]; import pkg_resources"}1' setup.py > setup.py.tmp
 %{__mv} setup.py.tmp setup.py
@@ -97,6 +100,9 @@ sed -i 's/%%(here)s/\/var\/lib\/tahrir/' apache/%{modname}.ini
 %attr(-,%{modname},root) %config(noreplace) %{_var}/lib/%{modname}
 
 %changelog
+* Mon Jul 14 2014 Ralph Bean <rbean at redhat.com> - 0.7.0-2
+- Patch thingiviewer to offset our badge stls.
+
 * Mon Jul 14 2014 Ralph Bean <rbean at redhat.com> - 0.7.0-1
 - Show STLs of badges in 3d.
 - Support exporting badges on the sugar stack.


More information about the scm-commits mailing list