protected fun generateNewCursorBox() { if (old_m_x2 !== -1 || old_m_y2 !== -1 || Math.abs(commonValues.m_x2 - old_m_x2) > 5 || Math.abs( commonValues.m_y2 - old_m_y2 ) > 5 ) { var top_x: Int = commonValues.m_x1 if (commonValues.m_x1 > commonValues.m_x2) { top_x = commonValues.m_x2 } var top_y: Int = commonValues.m_y1 if (commonValues.m_y1 > commonValues.m_y2) { top_y = commonValues.m_y2 } val w: Int = Math.abs(commonValues.m_x2 - commonValues.m_x1) val h: Int = Math.abs(commonValues.m_y2 - commonValues.m_y1) val currentRectangle = intArrayOf(top_x, top_y, w, h) decode_pdf.updateCursorBoxOnScreen( currentRectangle, DecoderOptions.highlightColor.getRGB() )if (!currentCommands.extractingAsImage) {val r = intArrayOf(commonValues.m_x1,commonValues.m_y1, commonValues.m_x2 - commonValues.m_x1, commonValues.m_y2 - commonValues.m_y1)decode_pdf.getTextLines().addHighlights(arrayOf(r), false, commonValues.getCurrentPage() } old_m_x2 = commonValues.m_x2 old_m_y2 = commonValues.m_y2 } decode_pdf.repaintPane(commonValues.getCurrentPage()) }
generate new cursorBox and highlight extractable text , if hardware acceleration off and extraction on < br > and update current cursor box displayed on screen