dmuratshin 9 年 前
コミット
ce5509da82

+ 5 - 0
oxygine/src/STDRenderer.cpp

@@ -235,6 +235,11 @@ namespace oxygine
         setViewProjTransform(view, proj);
     }
 
+    void STDRenderer::setViewProjTransform(const Matrix& viewProj)
+    {
+        _vp = viewProj;
+    }
+
     void STDRenderer::setViewProjTransform(const Matrix& view, const Matrix& proj)
     {
         _vp = view * proj;

+ 1 - 0
oxygine/src/STDRenderer.h

@@ -44,6 +44,7 @@ namespace oxygine
 
         void setDriver(IVideoDriver*);
         void setViewProjTransform(const Matrix& view, const Matrix& proj);
+        void setViewProjTransform(const Matrix& viewProj);
         void setVertexDeclaration(const VertexDeclaration* decl);
         void setUberShaderProgram(UberShaderProgram* pr);
         /**Sets blend mode. Default value is blend_premultiplied_alpha*/

+ 9 - 2
oxygine/src/TextField.cpp

@@ -211,12 +211,19 @@ namespace oxygine
         return const_cast<TextField*>(this)->getRootNode()->getSymbol(pos);
     }
 
-    const Rect& TextField::getTextRect()
+    const Rect& TextField::getTextRect() const
     {
-        getRootNode();
+        const_cast<TextField*>(this)->getRootNode();
         return _textRect;
     }
 
+    bool TextField::getBounds(RectF& r) const
+    {
+        r = getTextRect().cast<RectF>();
+        return true;
+    }
+
+
     text::Node* TextField::getRootNode()
     {
         if ((_flags & flag_rebuild) && _style.font)

+ 4 - 1
oxygine/src/TextField.h

@@ -27,7 +27,7 @@ namespace oxygine
         /**Returns current text style*/
         const TextStyle&            getStyle() const {return _style;}
         /**Returns text bounds*/
-        const Rect&                 getTextRect();
+        const Rect&                 getTextRect() const;
         /**Returns current text*/
         const std::string&          getText() const { return _text; }
         const Font*                 getFont() const;
@@ -40,6 +40,9 @@ namespace oxygine
         bool                        getBreakLongWords() const;
         text::Symbol*               getSymbolAt(int pos) const;
 
+
+        bool getBounds(RectF&) const OVERRIDE;
+
         /**Overwrites TextStyle Vertical align*/
         void setVAlign(TextStyle::VerticalAlign align);
         /**Overwrites TextStyle Horizontal align*/

+ 2 - 1
oxygine/src/math/Matrix.h

@@ -416,7 +416,8 @@ namespace oxygine
 
         if (scalar::abs(det) < T(0.0001))
         {
-            return out.identity();
+            out.identity();
+            return out;
         }
 
         det = T(1) / (det);