diff --git a/record-and-playback/presentation/scripts/publish/presentation.rb b/record-and-playback/presentation/scripts/publish/presentation.rb
index c07da286b9c3ab4ad62139bebb9aab5e7c7049e3..b94a59f377caa3ec155e029924526b13ea0eadae 100644
--- a/record-and-playback/presentation/scripts/publish/presentation.rb
+++ b/record-and-playback/presentation/scripts/publish/presentation.rb
@@ -285,7 +285,12 @@ def storeRectShape
 				$originX = $originX + rectWidth
 				rectWidth = rectWidth.abs
 			end
-			$xml.rect(:x => $originX, :y => $originY, :width => rectWidth, :height => rectHeight)
+                        if $is_square == "true"
+				#width of the square as reference
+                                $xml.rect(:x => $originX, :y => $originY, :width => rectWidth, :height => rectWidth)
+                        else
+                                $xml.rect(:x => $originX, :y => $originY, :width => rectWidth, :height => rectHeight)
+                        end
 			$prev_time = $shapeCreationTime
 		end
 	end
@@ -560,6 +565,7 @@ def processShapesAndClears
 
 							# Process the rectangle shapes
 							elsif $shapeType.eql? "rectangle"
+                                                                $is_square = shape.xpath(".//square")[0].text()
 								storeRectShape()
 
 							# Process the triangle shapes