File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -423,4 +423,30 @@ describe("evaluator", function () {
423423 expect ( operatorList . length ) . toEqual ( 0 ) ;
424424 } ) ;
425425 } ) ;
426+
427+ describe ( "graphics-state operators" , function ( ) {
428+ it ( "should convert negative line width to absolute value in the graphic state" , async function ( ) {
429+ const gState = new Dict ( ) ;
430+ gState . set ( "LW" , - 5 ) ;
431+ const extGState = new Dict ( ) ;
432+ extGState . set ( "GSneg" , gState ) ;
433+
434+ const resources = new ResourcesMock ( ) ;
435+ resources . ExtGState = extGState ;
436+
437+ const stream = new StringStream ( "/GSneg gs" ) ;
438+ const result = await runOperatorListCheck (
439+ partialEvaluator ,
440+ stream ,
441+ resources
442+ ) ;
443+
444+ expect ( result . fnArray ) . toEqual ( [ OPS . setGState ] ) ;
445+
446+ const stateEntries = result . argsArray [ 0 ] [ 0 ] ;
447+ const lwEntry = stateEntries . find ( ( [ key ] ) => key === "LW" ) ;
448+ expect ( lwEntry ) . toBeDefined ( ) ;
449+ expect ( lwEntry [ 1 ] ) . toEqual ( 5 ) ;
450+ } ) ;
451+ } ) ;
426452} ) ;
You can’t perform that action at this time.
0 commit comments