Replaced ~ with box operator in gfx.rs

Fixes compilation problem with Rust nightly.