Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 148025b

Browse files
committed
Various minor cleanups to FT2Font
1 parent 8ba1981 commit 148025b

2 files changed

Lines changed: 4 additions & 18 deletions

File tree

src/ft2font.cpp

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ FT2Image::~FT2Image() {
7777
_buffer = NULL;
7878
}
7979

80-
8180
Py::PythonClassObject<FT2Image> FT2Image::factory(int width, int height)
8281
{
8382
Py::Callable class_type(type());
@@ -90,16 +89,6 @@ Py::PythonClassObject<FT2Image> FT2Image::factory(int width, int height)
9089
return o;
9190
}
9291

93-
94-
// FT2Image::~FT2Image()
95-
// {
96-
// _VERBOSE("FT2Image::~FT2Image");
97-
// delete [] _buffer;
98-
// _buffer = NULL;
99-
// delete _rgbCopy;
100-
// delete _rgbaCopy;
101-
// }
102-
10392
void
10493
FT2Image::resize(long width, long height)
10594
{
@@ -209,7 +198,7 @@ PYCXX_VARARGS_METHOD_DECL(FT2Image, py_write_bitmap)
209198

210199
void
211200
FT2Image::draw_rect(unsigned long x0, unsigned long y0,
212-
unsigned long x1, unsigned long y1)
201+
unsigned long x1, unsigned long y1)
213202
{
214203
if (x0 > _width || x1 > _width ||
215204
y0 > _height || y1 > _height)
@@ -260,7 +249,7 @@ PYCXX_VARARGS_METHOD_DECL(FT2Image, py_draw_rect)
260249

261250
void
262251
FT2Image::draw_rect_filled(unsigned long x0, unsigned long y0,
263-
unsigned long x1, unsigned long y1)
252+
unsigned long x1, unsigned long y1)
264253
{
265254
x0 = std::min(x0, _width);
266255
y0 = std::min(y0, _height);
@@ -356,7 +345,7 @@ FT2Image::makeRgbCopy()
356345
return;
357346
}
358347

359-
if (!_rgbCopy.ptr())
348+
if (_rgbCopy.isNone())
360349
{
361350
_rgbCopy = factory(_width * 3, _height);
362351
rgbCopy = Py::PythonClassObject<FT2Image>(_rgbCopy).getCxxObject();
@@ -407,7 +396,7 @@ void FT2Image::makeRgbaCopy()
407396
return;
408397
}
409398

410-
if (_rgbaCopy.ptr())
399+
if (_rgbaCopy.isNone())
411400
{
412401
_rgbaCopy = factory(_width * 4, _height);
413402
rgbaCopy = Py::PythonClassObject<FT2Image>(_rgbaCopy).getCxxObject();

src/ft2font.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ class Glyph : public Py::PythonClass<Glyph>
9898
private:
9999
Py::Dict __dict__;
100100
static char get_path__doc__[];
101-
102-
Py::Tuple _empty_tuple;
103-
Py::Dict _empty_dict;
104101
};
105102

106103
class FT2Font : public Py::PythonClass<FT2Font>

0 commit comments

Comments
 (0)