Mercurial > hg > octave-lojdl
changeset 9405:7cc35bc348cc
Install text engine headers and fix rendering of 90x rotated text.
author | Michael Goffioul <michael.goffioul@gmail.com> |
---|---|
date | Sun, 28 Jun 2009 08:51:41 +0100 |
parents | 3dea4864921e |
children | c0c23dbbade7 |
files | src/ChangeLog src/Makefile.in src/gl-render.cc src/txt-eng-ft.cc |
diffstat | 4 files changed, 27 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2009-06-28 Michael Goffioul <michael.goffioul@gmail.com> + + * Makefile.in (INCLUDES): Install txt-eng.h and txt-eng-ft.h. + * gl-render.cc (opengl_renderer::draw_text): Fix bitmap offset + computation for 90x rotated text. + * txt-eng-ft.cc (ft_render::render): Compute bitmap pixels correctly + for 90x rotated text. + 2009-06-28 Jaroslav Hajek <highegg@gmail.com> * symtab.h (erase_scope (void *)): Remove overload.
--- a/src/Makefile.in +++ b/src/Makefile.in @@ -131,8 +131,8 @@ zfstream.h oct-strstrm.h oct-lvalue.h oct.h octave.h ops.h \ pager.h parse.h pr-output.h procstream.h sighandlers.h \ siglist.h sparse-xdiv.h sparse-xpow.h symtab.h sysdep.h \ - token.h toplev.h unwind-prot.h utils.h variables.h \ - version.h xdiv.h xnorm.h xpow.h \ + token.h toplev.h txt-eng.h txt-eng-ft.h unwind-prot.h \ + utils.h variables.h version.h xdiv.h xnorm.h xpow.h \ $(OV_INCLUDES) \ $(PT_INCLUDES) \ $(OV_SPARSE_INCLUDES)
--- a/src/gl-render.cc +++ b/src/gl-render.cc @@ -3037,16 +3037,16 @@ case ft_render::ROTATION_90: std::swap (x0, y0); std::swap (w, h); - x0 -= bbox(3); + x0 = -x0-bbox(3); break; case ft_render::ROTATION_180: - x0 -= bbox(2); - y0 -= bbox(3); + x0 = -x0-bbox(2); + y0 = -y0-bbox(3); break; case ft_render::ROTATION_270: std::swap (x0, y0); std::swap (w, h); - y0 -= bbox(2); + y0 = -y0-bbox(2); break; }
--- a/src/txt-eng-ft.cc +++ b/src/txt-eng-ft.cc @@ -421,14 +421,24 @@ { Array<idx_vector> idx (3); idx(0) = idx_vector (':'); - idx(1) = idx_vector (pixels.dim2()-1, 0, -1); - idx(2)= idx_vector (':'); + idx(1) = idx_vector (pixels.dim2()-1, -1, -1); + idx(2)= idx_vector (pixels.dim3()-1, -1, -1); pixels = uint8NDArray (pixels.index (idx)); } break; case ROTATION_270: { - // FIXME: implement this... + Array<octave_idx_type> perm (3); + perm(0) = 0; + perm(1) = 2; + perm(2) = 1; + pixels = pixels.permute (perm); + + Array<idx_vector> idx (3); + idx(0) = idx_vector (':'); + idx(1) = idx_vector (':'); + idx(2) = idx_vector (pixels.dim3()-1, -1, -1); + pixels = uint8NDArray (pixels.index (idx)); } break; }