[metapost] Trying to figure out MPLib

Shriramana Sharma samjnaa at gmail.com
Sat Aug 4 02:01:34 CEST 2012


Hello so I'm trying to access the internals of the linked list I
generated by (multiple calls to) mp_execute by doing:

	results = mp_rundata ( mp ) ;
	curfig = results -> edges ;
	while ( curfig != NULL )
	{
		printf ( "Current figure #%d has internal figure number %d, and
bounding box ll (%d,%d) to ur (%d,%d)\n", fignum, curfig -> charcode,
curfig -> minx, curfig -> miny, curfig -> maxx, curfig -> maxy ) ;
		curfig = curfig -> next ;
	}

and I get the output:

Current figure #0 has internal figure number 10, and bounding box ll
(-2063982,-1039307) to ur (690340,2603781)
Current figure #1 has internal figure number 20, and bounding box ll
(49152,-16384) to ur (1982464,671744)

I am guessing if I just do a simple integer division of this by 65536,
it'll be lossy and so I have to convert to double before I do that
right? Or would float be enough?

-- 
Shriramana Sharma


More information about the metapost mailing list