class PDF::Reader::TextRun

def intersection_area_percent(other_run)

return what percentage of this text run is overlapped by another run
def intersection_area_percent(other_run)
  return 0 unless intersect?(other_run)
  dx = [endx, other_run.endx].min - [x, other_run.x].max
  dy = [endy, other_run.endy].min - [y, other_run.y].max
  intersection_area = dx*dy
  intersection_area.to_f / area
end