fix(core): 修复 Device 中缩放与截图 Hook 的处理顺序不正确问题

This commit is contained in:
XcantloadX 2025-06-28 17:47:25 +08:00
parent 9935087753
commit e8851a683d
2 changed files with 3 additions and 3 deletions

View File

@ -339,9 +339,9 @@ class Device:
logger.debug("screenshot hook before returned image")
return img
img = self.screenshot_raw()
img = self.__scale_image(img)
if self.screenshot_hook_after is not None:
img = self.screenshot_hook_after(img)
img = self.__scale_image(img)
return img
def screenshot_raw(self) -> MatLike:

View File

@ -4,7 +4,7 @@ import runpy
import logging
import argparse
from kaa.common import BaseConfig
from kotonebot.kaa.common import BaseConfig
def run_script(script_path: str) -> None:
@ -21,7 +21,7 @@ def run_script(script_path: str) -> None:
print(f"正在运行脚本: {script_path}")
# 运行脚本
from kotonebot.backend.context import init_context, manual_context
from kaa.main.kaa import Kaa
from kotonebot.kaa.main.kaa import Kaa
logging.getLogger('kotonebot').setLevel(logging.DEBUG)
config_path = './config.json'
kaa_instance = Kaa(config_path)