Author: Carlos Lopez <[email protected]>
Date:   Sat Jun  9 11:13:42 2012 +0200

ETL surface: Allow to pass the pitch when resizing a surface.

---

 ETL/ETL/_surface.h |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/ETL/ETL/_surface.h b/ETL/ETL/_surface.h
index d58663f..22fcac3 100644
--- a/ETL/ETL/_surface.h
+++ b/ETL/ETL/_surface.h
@@ -208,7 +208,7 @@ public:
        }
 
        virtual void
-       set_wh(typename size_type::value_type w, typename size_type::value_type 
h)
+       set_wh(typename size_type::value_type w, typename size_type::value_type 
h, const typename size_type::value_type &pitch=0)
        {
                if(data_)
                {
@@ -220,8 +220,11 @@ public:
 
                w_=w;
                h_=h;
-               pitch_=sizeof(value_type)*w_;
-               zero_pos_=data_=new value_type[h_*w_];
+               if(pitch)
+                       pitch_=pitch;
+               else
+                       pitch_=sizeof(value_type)*w_;
+               zero_pos_=data_=(pointer)(new char[pitch_*h_]);
                deletable_=true;
        }
 


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to