<commit_before>-- Stage

Stage = class(DisplayObjContainer)

function Stage:init(viewport)
	DisplayObjContainer.init(self)
    self._prop:setViewport(viewport)
    
    self._debugDeck = MOAIScriptDeck.new ()
    --self._debugDeck:setRect ( -64, -64, 64, 64 )
    self._debugDeck:setDrawCallback ( function()
			if self._showAABounds then
				self:drawAABounds(false)
			end
			if self._showOrientedBounds then
				self:drawOrientedBounds()
			end
		end
	)

    self._debugProp = MOAIProp.new ()
    self._debugProp:setDeck ( self._debugDeck )
    
    self._rt = {self._renderTable}
end

--Stage is a Layer not a 'generic' prop like ALL the others displayObjs
function Stage:_createProp()
    return MOAILayer.new()
end

function Stage:showDebugLines(showOrientedBounds,showAABounds)
	self._showOrientedBounds = showOrientedBounds or false
	self._showAABounds = showAABounds or true
	
	local showDebug = self._showOrientedBounds or self._showAABounds
	
	if showDebug and not self._rt[2] then
		self._rt[2] = self._debugProp
	end
	if not showDebug and self._rt[2] then
		self._rt[2] = nil
	end
end

--with moai 1.4 clearColor funciton was moved to frameBuffer and removed from GfxDevice.
local function __setClearColor(r,g,b,a)
	if MOAIGfxDevice.getFrameBuffer then
		MOAIGfxDevice.getFrameBuffer():setClearColor(r,g,b,a)
	else
		MOAIGfxDevice.setClearColor(r,g,b,a)
	end
end

function Stage:setBackground(r,g,b)
	if class_type(r) == Color then
		__setClearColor(r:unpack_normalized())
	else
		__setClearColor(r/255,g/255,b/255,1)
	end
end

--the method is called by a DisplayObjContainer when the DisplayObj is
--added as child
function Stage:_setParent(parent)
    error("Stage cannot be child of another DisplayObjContainer")
end

function Stage:setPivot(x,y)
    error("It's not possible to set geometric properties of a Stage")
end

function Stage:setPivotX(x)
    error("It's not possible to set geometric properties of a Stage")
end

function Stage:setPivotY(y)
    error("It's not possible to set geometric properties of a Stage")
end

function Stage:setPosition(x,y)
    error("It's not possible to set geometric properties of a Stage")
end

function Stage:setPosition_v2(v)
    error("It's not possible to set geometric properties of a Stage")
end

function Stage:setPositionX(x)
    error("It's not possible to set geometric properties of a Stage")
end

function Stage:setPositionY(y)
    error("It's not possible to set geometric properties of a Stage")
end

function Stage:translate(x,y)
    error("It's not possible to set geometric properties of a Stage")
end

-- rotation angle is expressed in radians
function Stage:setRotation(r)
    error("It's not possible to set geometric properties of a Stage")
end

function Stage:setScale(x,y)
    error("It's not possible to set geometric properties of a Stage")
end

function Stage:setScale_v2(v)
    error("It's not possible to set geometric properties of a Stage")
end

function Stage:setScaleX(s)
    error("It's not possible to set geometric properties of a Stage")
end

function Stage:setScaleY(s)
    error("It's not possible to set geometric properties of a Stage")
end
<commit_msg>stage:showDebugLines - fix for defaultValues<commit_after>-- Stage

Stage = class(DisplayObjContainer)

function Stage:init(viewport)
	DisplayObjContainer.init(self)
    self._prop:setViewport(viewport)
    
    self._debugDeck = MOAIScriptDeck.new ()
    --self._debugDeck:setRect ( -64, -64, 64, 64 )
    self._debugDeck:setDrawCallback ( function()
			if self._showAABounds then
				self:drawAABounds(false)
			end
			if self._showOrientedBounds then
				self:drawOrientedBounds()
			end
		end
	)

    self._debugProp = MOAIProp.new ()
    self._debugProp:setDeck ( self._debugDeck )
    
    self._rt = {self._renderTable}
end

--Stage is a Layer not a 'generic' prop like ALL the others displayObjs
function Stage:_createProp()
    return MOAILayer.new()
end

function Stage:showDebugLines(showOrientedBounds,showAABounds)
	self._showOrientedBounds = showOrientedBounds ~= nil and showOrientedBounds or true
	self._showAABounds = showAABounds ~= nil and showAABounds or false
	
	local showDebug = self._showOrientedBounds or self._showAABounds
	
	if showDebug and not self._rt[2] then
		self._rt[2] = self._debugProp
	end
	if not showDebug and self._rt[2] then
		self._rt[2] = nil
	end
end

--with moai 1.4 clearColor funciton was moved to frameBuffer and removed from GfxDevice.
local function __setClearColor(r,g,b,a)
	if MOAIGfxDevice.getFrameBuffer then
		MOAIGfxDevice.getFrameBuffer():setClearColor(r,g,b,a)
	else
		MOAIGfxDevice.setClearColor(r,g,b,a)
	end
end

function Stage:setBackground(r,g,b)
	if class_type(r) == Color then
		__setClearColor(r:unpack_normalized())
	else
		__setClearColor(r/255,g/255,b/255,1)
	end
end

--the method is called by a DisplayObjContainer when the DisplayObj is
--added as child
function Stage:_setParent(parent)
    error("Stage cannot be child of another DisplayObjContainer")
end

function Stage:setPivot(x,y)
    error("It's not possible to set geometric properties of a Stage")
end

function Stage:setPivotX(x)
    error("It's not possible to set geometric properties of a Stage")
end

function Stage:setPivotY(y)
    error("It's not possible to set geometric properties of a Stage")
end

function Stage:setPosition(x,y)
    error("It's not possible to set geometric properties of a Stage")
end

function Stage:setPosition_v2(v)
    error("It's not possible to set geometric properties of a Stage")
end

function Stage:setPositionX(x)
    error("It's not possible to set geometric properties of a Stage")
end

function Stage:setPositionY(y)
    error("It's not possible to set geometric properties of a Stage")
end

function Stage:translate(x,y)
    error("It's not possible to set geometric properties of a Stage")
end

-- rotation angle is expressed in radians
function Stage:setRotation(r)
    error("It's not possible to set geometric properties of a Stage")
end

function Stage:setScale(x,y)
    error("It's not possible to set geometric properties of a Stage")
end

function Stage:setScale_v2(v)
    error("It's not possible to set geometric properties of a Stage")
end

function Stage:setScaleX(s)
    error("It's not possible to set geometric properties of a Stage")
end

function Stage:setScaleY(s)
    error("It's not possible to set geometric properties of a Stage")
end

{'fraction_non_alphanumeric': 0.08459971800094, 'fraction_numerical': 0.008146639511201629, 'mean_word_length': 4.62962962962963, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1521448', 'n_tokens_mistral': 2125, 'n_tokens_neox': 2009, 'n_words': 653}