mirror of https://github.com/axmolengine/axmol.git
fixed #2217: Updating logic when m_bIgnoreContentScaleFactor is enabled.
This commit is contained in:
parent
42102bcf0a
commit
d6a0af86eb
|
@ -121,15 +121,12 @@ bool CCAtlasNode::initWithTexture(CCTexture2D* texture, unsigned int tileWidth,
|
||||||
|
|
||||||
void CCAtlasNode::calculateMaxItems()
|
void CCAtlasNode::calculateMaxItems()
|
||||||
{
|
{
|
||||||
CCSize s;
|
CCSize s = m_pTextureAtlas->getTexture()->getContentSize();
|
||||||
|
|
||||||
if (m_bIgnoreContentScaleFactor)
|
if (m_bIgnoreContentScaleFactor)
|
||||||
{
|
{
|
||||||
s = m_pTextureAtlas->getTexture()->getContentSizeInPixels();
|
s = m_pTextureAtlas->getTexture()->getContentSizeInPixels();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
s = m_pTextureAtlas->getTexture()->getContentSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_uItemsPerColumn = (int)(s.height / m_uItemHeight);
|
m_uItemsPerColumn = (int)(s.height / m_uItemHeight);
|
||||||
m_uItemsPerRow = (int)(s.width / m_uItemWidth);
|
m_uItemsPerRow = (int)(s.width / m_uItemWidth);
|
||||||
|
|
|
@ -123,18 +123,14 @@ void CCLabelAtlas::updateAtlasValues()
|
||||||
CCTexture2D *texture = m_pTextureAtlas->getTexture();
|
CCTexture2D *texture = m_pTextureAtlas->getTexture();
|
||||||
float textureWide = (float) texture->getPixelsWide();
|
float textureWide = (float) texture->getPixelsWide();
|
||||||
float textureHigh = (float) texture->getPixelsHigh();
|
float textureHigh = (float) texture->getPixelsHigh();
|
||||||
float itemWidthInPixels;
|
float itemWidthInPixels = m_uItemWidth * CC_CONTENT_SCALE_FACTOR();
|
||||||
float itemHeightInPixels;
|
float itemHeightInPixels = m_uItemHeight * CC_CONTENT_SCALE_FACTOR();
|
||||||
|
|
||||||
if (m_bIgnoreContentScaleFactor)
|
if (m_bIgnoreContentScaleFactor)
|
||||||
{
|
{
|
||||||
itemWidthInPixels = m_uItemWidth;
|
itemWidthInPixels = m_uItemWidth;
|
||||||
itemHeightInPixels = m_uItemHeight;
|
itemHeightInPixels = m_uItemHeight;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
itemWidthInPixels = m_uItemWidth * CC_CONTENT_SCALE_FACTOR();
|
|
||||||
itemHeightInPixels = m_uItemHeight * CC_CONTENT_SCALE_FACTOR();
|
|
||||||
}
|
|
||||||
|
|
||||||
for(unsigned int i = 0; i < n; i++) {
|
for(unsigned int i = 0; i < n; i++) {
|
||||||
unsigned char a = s[i] - m_uMapStartChar;
|
unsigned char a = s[i] - m_uMapStartChar;
|
||||||
|
|
Loading…
Reference in New Issue