Skip to content
Snippets Groups Projects
Commit d19d9b80 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

Text outside viewport was not suppressed!!!

parent 3f7948c0
No related branches found
No related tags found
No related merge requests found
/* /*
* GL2PS, an OpenGL to PostScript Printing Library * GL2PS, an OpenGL to PostScript Printing Library
* Copyright (C) 1999-2001 Christophe Geuzaine * Copyright (C) 1999-2002 Christophe Geuzaine
* *
* $Id: gl2ps.cpp,v 1.34 2001-11-20 08:04:59 geuzaine Exp $ * $Id: gl2ps.cpp,v 1.35 2002-01-22 16:54:16 geuzaine Exp $
* *
* E-mail: Christophe.Geuzaine@AdValvas.be * E-mail: geuz@geuz.org
* URL: http://www.geuz.org/gl2ps/ * URL: http://www.geuz.org/gl2ps/
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
...@@ -1099,7 +1099,7 @@ GLvoid gl2psPrintPostScriptHeader(GLvoid){ ...@@ -1099,7 +1099,7 @@ GLvoid gl2psPrintPostScriptHeader(GLvoid){
"%%%%Orientation: Portrait\n" "%%%%Orientation: Portrait\n"
"%%%%DocumentMedia: Default %d %d 0 () ()\n" "%%%%DocumentMedia: Default %d %d 0 () ()\n"
"%%%%BoundingBox: %d %d %d %d\n" "%%%%BoundingBox: %d %d %d %d\n"
"%%%%Copyright: GNU LGPL (C) 1999-2001 Christophe.Geuzaine@AdValvas.be\n" "%%%%Copyright: GNU LGPL (C) 1999-2002 geuz@geuz.org\n"
"%%%%EndComments\n" "%%%%EndComments\n"
"%%%%BeginProlog\n" "%%%%BeginProlog\n"
"/gl2psdict 64 dict def gl2psdict begin\n" "/gl2psdict 64 dict def gl2psdict begin\n"
...@@ -1450,15 +1450,20 @@ GLint gl2psEndPage(GLvoid){ ...@@ -1450,15 +1450,20 @@ GLint gl2psEndPage(GLvoid){
GLvoid gl2psText(char *str, char *fontname, GLint fontsize){ GLvoid gl2psText(char *str, char *fontname, GLint fontsize){
GLfloat pos[4]; GLfloat pos[4];
GL2PSprimitive *prim; GL2PSprimitive *prim;
GLboolean valid;
if(gl2ps.options & GL2PS_NO_TEXT) return; if(gl2ps.options & GL2PS_NO_TEXT) return;
glGetBooleanv(GL_CURRENT_RASTER_POSITION_VALID, &valid);
if(!valid) return; /* the primitive is culled */
glGetFloatv(GL_CURRENT_RASTER_POSITION, pos);
prim = (GL2PSprimitive *)gl2psMalloc(sizeof(GL2PSprimitive)); prim = (GL2PSprimitive *)gl2psMalloc(sizeof(GL2PSprimitive));
prim->type = GL2PS_TEXT; prim->type = GL2PS_TEXT;
prim->boundary = 0; prim->boundary = 0;
prim->numverts = 1; prim->numverts = 1;
prim->verts = (GL2PSvertex *)gl2psMalloc(sizeof(GL2PSvertex)); prim->verts = (GL2PSvertex *)gl2psMalloc(sizeof(GL2PSvertex));
glGetFloatv(GL_CURRENT_RASTER_POSITION, pos);
prim->verts[0].xyz[0] = pos[0]; prim->verts[0].xyz[0] = pos[0];
prim->verts[0].xyz[1] = pos[1]; prim->verts[0].xyz[1] = pos[1];
prim->verts[0].xyz[2] = pos[2]; prim->verts[0].xyz[2] = pos[2];
......
/* /*
* GL2PS, an OpenGL to PostScript Printing Library * GL2PS, an OpenGL to PostScript Printing Library
* Copyright (C) 1999-2001 Christophe Geuzaine * Copyright (C) 1999-2002 Christophe Geuzaine
* *
* $Id: gl2ps.h,v 1.15 2001-11-19 10:43:16 geuzaine Exp $ * $Id: gl2ps.h,v 1.16 2002-01-22 16:54:16 geuzaine Exp $
* *
* E-mail: Christophe.Geuzaine@AdValvas.be * E-mail: geuz@geuz.org
* URL: http://www.geuz.org/gl2ps/ * URL: http://www.geuz.org/gl2ps/
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#endif #endif
#include <GL/gl.h> #include <GL/gl.h>
#define GL2PS_VERSION 0.5 #define GL2PS_VERSION 0.51
#define GL2PS_NONE 0 #define GL2PS_NONE 0
/* Output file format */ /* Output file format */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment