Skip to content

Commit

Permalink
Use ctrl as meta key for 'find next' behavior. (#23214) (#23218) (#23219
Browse files Browse the repository at this point in the history
)

* Use ctrl as meta key for 'find next' behavior. (#23214)

* Use ctrl as meta key for 'find next' behavior.

* Bugfix

* Fix text layer scale bug. (#23216)

---------

Co-authored-by: davywentwortht2it <david.wentworth@va.gov>
  • Loading branch information
mikefinneran and davywentwortht2it authored Oct 15, 2024
1 parent 0db802a commit 5076e9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion client/app/readerprototype/components/ReaderSearchBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ const ReaderSearchBar = () => {
// handle keyboard control of search results
useEffect(() => {
const keyHandler = (event) => {
if (event.metaKey && event.code === 'KeyG') {
const metaKey = navigator.appVersion.includes('Win') ? 'ctrlKey' : 'metaKey';

if (event[metaKey] && event.code === 'KeyG') {
event.preventDefault();
if (event.shiftKey) {
previous();
Expand Down
7 changes: 3 additions & 4 deletions client/app/readerprototype/components/TextLayer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ const TextLayer = memo((props) => {
// tracking this, the search bar will report double the number of found instances
const [hasRenderedText, setHasRenderedText] = useState(false);

const viewport = page.getViewport({ scale: zoomLevel / 100 });
const viewport = page.getViewport({ scale: 1 });
const textLayerRef = useRef(null);
let positionX = 0;
let positionY = 0;
const fullSizeViewport = page.getViewport({ scale: 1 });

if (rotation.includes('90')) {
positionX = viewport.height;
Expand All @@ -30,8 +29,8 @@ const TextLayer = memo((props) => {
}

const textLayerStyle = {
width: `${fullSizeViewport.width}px`,
height: `${fullSizeViewport.height}px`,
width: `${viewport.width}px`,
height: `${viewport.height}px`,
transformOrigin: 'left top',
opacity: 1,
position: 'absolute',
Expand Down

0 comments on commit 5076e9c

Please sign in to comment.