Skip to content

Commit

Permalink
fix: zoom in/out click (#12056)
Browse files Browse the repository at this point in the history
Co-authored-by: marvin <[email protected]>
  • Loading branch information
marvin-season and marvin-season-bankup authored Dec 25, 2024
1 parent c98d91e commit b281a80
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions web/app/components/workflow/operator/zoom-in-out.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ const ZoomInOut: FC = () => {
crossAxis: -2,
}}
>
<PortalToFollowElemTrigger asChild onClick={handleTrigger}>
<PortalToFollowElemTrigger asChild>
<div className={`
p-0.5 h-9 cursor-pointer text-[13px] backdrop-blur-[5px] rounded-lg
bg-components-actionbar-bg shadow-lg border-[0.5px] border-components-actionbar-border
Expand All @@ -144,23 +144,29 @@ const ZoomInOut: FC = () => {
shortcuts={['ctrl', '-']}
>
<div
className='flex items-center justify-center w-8 h-8 rounded-lg cursor-pointer'
className={`flex items-center justify-center w-8 h-8 rounded-lg ${zoom <= 0.25 ? 'cursor-not-allowed' : 'cursor-pointer hover:bg-black/5'}`}
onClick={(e) => {
if (zoom <= 0.25)
return

e.stopPropagation()
zoomOut()
}}
>
<RiZoomOutLine className='w-4 h-4 text-text-tertiary hover:text-text-secondary' />
</div>
</TipPopup>
<div className={cn('w-[34px] system-sm-medium text-text-tertiary hover:text-text-secondary')}>{parseFloat(`${zoom * 100}`).toFixed(0)}%</div>
<div onClick={handleTrigger} className={cn('w-[34px] system-sm-medium text-text-tertiary hover:text-text-secondary')}>{parseFloat(`${zoom * 100}`).toFixed(0)}%</div>
<TipPopup
title={t('workflow.operator.zoomIn')}
shortcuts={['ctrl', '+']}
>
<div
className='flex items-center justify-center w-8 h-8 rounded-lg cursor-pointer'
className={`flex items-center justify-center w-8 h-8 rounded-lg ${zoom >= 2 ? 'cursor-not-allowed' : 'cursor-pointer hover:bg-black/5'}`}
onClick={(e) => {
if (zoom >= 2)
return

e.stopPropagation()
zoomIn()
}}
Expand Down

0 comments on commit b281a80

Please sign in to comment.