Ruler tool operation assistance method, apparatus, device, medium, and program product
Patent Information
- Application Number
- CN202610843194.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-11
- Publication Date
- 2026-10-20
AI Technical Summary
[0004]然而,相关技术中的直尺工具的操作辅助功能较为局限,难以兼容不同触控笔的使用需求
[0034]上述直尺工具的操作辅助方法、装置、设备、介质和程序产品,响应于触控笔在当前屏幕中触发的笔触动作,先获取触控笔在当前屏幕中的笔触坐标;其中,当前屏幕中显示有直尺工具;然后调用统一的笔触处理函数,将笔触坐标投影至直尺工具的边缘,得到笔触坐标所需的投影修正坐标;接着调用与触控笔的类型相匹配的绘制函数按照投影修正坐标,进行触控笔对直尺工具的操作功能。该方法,在检测到触控笔触发笔触动作并获取原始笔触坐标的情况下,通过设置统一的笔触处理函数,对不同类型触控笔的笔触坐标统一执行向直尺工具边缘的投影矫正处理,标准化输出投影修正坐标,同时依据触控笔的实际类型匹配调用对应的专属绘制函数完成绘制操作,无需针对系统笔、自定义笔等不同触控笔单独改造矫正逻辑与绘制逻辑,能够适配多类触控笔的运行机制与绘制规则,有效实现不同触控笔在直尺工具场景下的适配兼容,保障各类触控笔均可稳定依托直尺工具完成规整化绘图操作。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This application relates to the field of application development technology, and in particular to an operation assistance method, device, equipment, medium and program product for a ruler tool. Background Technology
[0002] With the rapid development of technology, terminal devices support increasingly rich functional components, such as drawing functions and document annotation functions.
[0003] To further enhance the performance of terminal devices, auxiliary tools are typically added to their functional components. Taking a ruler as an example, related technologies allow for standardized drawing and document annotation by dragging and rotating the ruler on the terminal device's display screen using a stylus.
[0004] However, the operation assistance function of the ruler tool in the relevant technology is relatively limited and it is difficult to be compatible with the usage needs of different styluses. Summary of the Invention
[0005] Therefore, it is necessary to provide an operation assistance method, device, equipment, medium, and program product for a ruler tool to address the above-mentioned technical problems, which can expand the operation assistance function of the ruler tool and be compatible with the usage needs of different styluses.
[0006] Firstly, this application provides an operational assistance method for a ruler tool, applied to a terminal device, the method comprising:
[0007] In response to a stylus stroke triggered on the current screen, obtain the stylus stroke coordinates on the current screen, where a ruler tool is displayed on the current screen;
[0008] Calling a unified stroke processing function projects the stroke coordinates onto the edge of the ruler tool, obtaining the required projection correction coordinates for the stroke coordinates; and
[0009] Call the drawing function that matches the type of stylus to correct the coordinates according to the projection, and perform the stylus operation function on the ruler tool.
[0010] In one embodiment, a unified stroke processing function is invoked to project the stroke coordinates onto the edge of the ruler tool, obtaining the projection correction coordinates required for the stroke coordinates, including:
[0011] Call the pen touch processing function to obtain the drawing width corresponding to the stylus;
[0012] Project the stroke coordinates vertically onto the edge of the ruler tool to obtain the projected coordinates; and
[0013] The projection coordinates are offset and compensated based on the drawing width to obtain the projection correction coordinates corresponding to the stroke coordinates.
[0014] In one embodiment, it further includes:
[0015] In response to an erase operation triggered by the stylus on the current screen, the stylus touch processing function is called to obtain multiple movement trajectory points of the stylus on the current screen; and
[0016] The erasure path of the erasure action is processed based on the distance between multiple movement trajectory points and the ruler tool.
[0017] In one embodiment, the erasure path of the erasure action is processed based on the distance between multiple movement trajectory points and the ruler tool, including:
[0018] For any one of multiple movement trajectory points, if the distance between the movement trajectory point and the ruler is greater than a preset threshold, the erase operation corresponding to that movement trajectory point is filtered out; and
[0019] If the distance between the moving trajectory point and the ruler is less than or equal to a preset threshold, the erase operation corresponding to the moving trajectory point is executed.
[0020] In one embodiment, it further includes at least one of the following:
[0021] In response to a drag instruction for the ruler tool, move the ruler tool to the position corresponding to the drag instruction;
[0022] In response to a rotation instruction for the ruler tool, display an angle gauge on the current screen and rotate the ruler tool according to the indicated angle;
[0023] In response to zooming operations on the current screen, obtain the zoom ratio and adjust the ruler tool's scale spacing based on the zoom ratio.
[0024] In one embodiment, it further includes:
[0025] In response to the ruler tool display action triggered in the current screen, the ruler display function is called to create the ruler tool and float it in the current screen;
[0026] The length of the ruler tool is n times the current screen size, where n is a positive number greater than 1.
[0027] Secondly, this application also provides an operating aid for a ruler tool, comprising:
[0028] The coordinate acquisition module is used to respond to the pen stroke action triggered by the stylus on the current screen and acquire the pen stroke coordinates on the current screen, where a ruler tool is displayed on the current screen.
[0029] The coordinate projection module is used to call a unified stroke processing function to project the stroke coordinates onto the edge of the ruler tool, obtaining the required projection correction coordinates for the stroke coordinates; and
[0030] The operation assistance module is used to call the drawing function that matches the type of stylus, correct the coordinates according to the projection, and perform the operation function of the stylus on the ruler tool.
[0031] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the computer program is used to implement the method in any of the embodiments of the first aspect described above.
[0032] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method in any of the embodiments of the first aspect described above.
[0033] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the method in any of the embodiments of the first aspect described above.
[0034] The aforementioned operating assistance method, device, equipment, medium, and program product for the ruler tool, in response to a stylus stroke triggered on the current screen, first obtains the stylus stroke coordinates on the current screen, wherein the ruler tool is displayed on the current screen; then, a unified stroke processing function is called to project the stroke coordinates onto the edge of the ruler tool to obtain the projection correction coordinates required for the stroke coordinates; next, a drawing function matching the type of stylus is called to perform the stylus's operation function on the ruler tool according to the projection correction coordinates. This method, upon detecting a stylus-triggered stroke action and obtaining the original stroke coordinates, uses a unified stroke processing function to uniformly perform projection correction processing on the stroke coordinates of different types of styluses towards the edge of the ruler tool, standardizing the output of the projection correction coordinates. Simultaneously, it matches and calls the corresponding dedicated drawing function according to the actual type of stylus to complete the drawing operation. There is no need to modify the correction logic and drawing logic separately for different styluses such as system pens and custom pens. It can adapt to the operating mechanism and drawing rules of multiple types of styluses, effectively achieving compatibility and adaptation of different styluses in the ruler tool scenario, ensuring that all types of styluses can stably complete standardized drawing operations using the ruler tool. Attached Figure Description
[0035] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort. In the drawings:
[0036] Figure 1 This is an internal structure diagram of a terminal device in one embodiment;
[0037] Figure 2 This is a flowchart illustrating an operation assistance method for a ruler tool in one embodiment;
[0038] Figure 3 This is a flowchart illustrating the contact adsorption step in one embodiment;
[0039] Figure 4 This is a schematic diagram of the interface for pen stroke coordinate projection correction in one embodiment;
[0040] Figure 5 This is a flowchart illustrating the path restriction erasure step in one embodiment;
[0041] Figure 6 A schematic diagram of the ruler tool interface in one embodiment; and
[0042] Figure 7 This is a structural block diagram of an operation aid device for a ruler tool in one embodiment. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0044] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0045] First, let me explain the technical background of this application.
[0046] With the rapid development of technology, in order to improve the performance of terminal devices, auxiliary tools are usually added to the functional components of the terminal devices.
[0047] Taking a ruler as an example of an auxiliary tool, in related technologies, by using a stylus to drag and rotate the ruler on the display screen of a terminal device, one can perform standardized drawing, document annotation, and other tasks.
[0048] However, existing system ruler tools based on native system drawing frameworks (such as the PencilKit framework) are mainly used in tablet drawing and note-taking applications, providing line snapping drawing functionality, but they have the following main limitations:
[0049] (1) It is only compatible with the standard pen tools provided by the system and does not support third-party custom pen types or brushes.
[0050] (2) The ruler view is limited to a single PDF page or canvas boundary and cannot cover the entire application interface or multi-page document in a floating form.
[0051] (3) It does not support dynamic scale adjustment based on view zoom level and cannot correspond to the actual paper size such as A4, A3 and other standard specifications in real time.
[0052] (4) The eraser tool has poor path control in the straight-line adsorption state and fails to visually form the eraser's movement trajectory adsorbed on the ruler.
[0053] (5) The key parameters such as adsorption offset, scale density, and alignment sensitivity are all fixed values and cannot be dynamically adjusted according to the current pen width, scale or specific usage scenario.
[0054] In addition, some third-party note-taking applications, such as GoodNotes, have implemented self-developed ruler functions, but because they have not deeply integrated with the system's native drawing framework, their custom rulers cannot effectively snap to, align or constrain the system's native handwriting, resulting in a disconnect between the two ruler tool experiences.
[0055] Due to the aforementioned shortcomings, the ruler tool in related technologies limits the user's operational efficiency, drawing accuracy, and tool flexibility in scenarios such as multi-page PDF annotation, engineering drawing, fine geometric drawing, and high-precision auxiliary drawing.
[0056] In summary, considering that the operation assistance functions of the ruler tool in the related technology are relatively limited and difficult to be compatible with the usage needs of different styluses, this application provides an operation assistance method for the ruler tool, which enables the ruler tool to have stronger compatibility, global floating, dynamic scaling support, eraser path constraint capability and real-time adjustment of key parameters, thereby significantly improving the drawing experience and accuracy based on the native drawing framework.
[0057] The ruler tool operation assistance method provided in this application embodiment can be applied to terminal devices, and its internal structure diagram can be as follows: Figure 1 As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements an auxiliary method for operating a ruler tool. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0058] Those skilled in the art will understand that Figure 1 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0059] In one exemplary embodiment, such as Figure 2 As shown, a method for assisting in the operation of a ruler tool is provided, and the method is applied to a terminal device for illustration, including the following steps:
[0060] S201, in response to a pen stroke triggered by the stylus on the current screen, obtains the pen stroke coordinates on the current screen, wherein a ruler tool is displayed on the current screen.
[0061] The ruler tool is an on-screen visual aid for drawing on a terminal device. It can be displayed within some applications on the terminal device (such as notes, documents, and canvas) to assist in text alignment, document annotation, or line drawing.
[0062] It should be noted that when the ruler tool is displayed on the current screen, the ruler tool's line snapping function is enabled by default to assist users in writing or drawing on the current screen using a stylus.
[0063] In practical applications, in response to the pen strokes triggered by the stylus on the current screen, the pen stroke coordinates corresponding to the pen strokes are intercepted based on the coordinate system of the current screen.
[0064] Optionally, the pen stroke action is a pressing action, and the pen stroke coordinates on the current screen are a single coordinate; the pen stroke coordinates of the pen stroke action in the coordinate system of the current screen are obtained. Optionally, the pen stroke action is a sliding action, and the pen stroke coordinates on the current screen include multiple coordinates; the multiple pen stroke coordinates of the pen stroke action in the coordinate system of the current screen are obtained.
[0065] S202 calls the unified stroke processing function to project the stroke coordinates onto the edge of the ruler tool, obtaining the projection correction coordinates required for the stroke coordinates.
[0066] It should be emphasized that the pen touch processing function in the embodiments of this application is used to process the pen touch coordinates of various types of styluses, and the pen touch processing function can interface with the drawing function of various types of styluses to pass the processed pen touch coordinates to the drawing function of the corresponding styluse.
[0067] Input the stroke coordinates into the stroke processing function. By calling the stroke processing function, the stroke coordinates are snapped to the edge of the ruler tool. For example, by combining the geometric parameters such as the edge position and angle of the ruler tool, the stroke coordinates are mapped and attached to the edge position of the ruler tool through the point-to-line projection algorithm. After unified calculation and processing, the projection correction coordinates adapted to the ruler drawing rules are output.
[0068] S203 calls the drawing function that matches the type of stylus, corrects the coordinates according to the projection, and performs the stylus operation function on the ruler tool.
[0069] The system identifies the type of stylus currently in use, such as the system stylus or a custom stylus. Then, based on the stylus type, it matches and retrieves the drawing function that is specifically adapted to the stylus. Using the calculated projection correction coordinates as the drawing reference, it replaces the original stylus coordinates to perform screen rendering, thereby completing auxiliary operations such as straight line drawing and edge alignment performed by various styluses using the ruler tool.
[0070] In this embodiment, in response to a stylus stroke triggered on the current screen, the stylus stroke coordinates on the current screen are first obtained, where a ruler tool is displayed on the current screen. Then, a unified stroke processing function is called to project the stroke coordinates onto the edge of the ruler tool, obtaining the projection correction coordinates required for the stroke coordinates. Next, a drawing function matching the stylus type is called to perform the stylus's operation on the ruler tool according to the projection correction coordinates. This method, upon detecting a stylus stroke and obtaining the original stroke coordinates, uses a unified stroke processing function to uniformly perform projection correction processing on the stroke coordinates of different types of styluses onto the edge of the ruler tool, standardizing the output of the projection correction coordinates. Simultaneously, it calls the corresponding dedicated drawing function according to the actual type of stylus to complete the drawing operation. This eliminates the need to modify the correction and drawing logic separately for different styluses such as system pens and custom pens, adapting to the operating mechanisms and drawing rules of multiple types of styluses. It effectively achieves compatibility and adaptation of different styluses in the ruler tool scenario, ensuring that all types of styluses can stably complete standardized drawing operations using the ruler tool.
[0071] As can be seen from the foregoing embodiments, the pen stroke processing function has a ruler-attaching function. The principle of the ruler-attaching function of the pen stroke processing function will be further explained below. In an exemplary embodiment, such as... Figure 3 As shown, a unified stroke processing function is called to project the stroke coordinates onto the edge of the ruler tool, obtaining the required projection correction coordinates for the stroke coordinates, including:
[0072] S301, call the pen touch processing function to get the drawing width corresponding to the stylus.
[0073] In response to the pen stroke action triggered by the stylus on the current screen, while obtaining the pen stroke coordinates, it also identifies the type of stylus currently being used, such as the system pen or a custom pen, and determines the drawing width that matches the stylus type based on the mapping relationship between the stylus type and the pen width.
[0074] S302, project the pen stroke coordinates vertically onto the edge of the ruler tool to obtain the projected coordinates.
[0075] Along the direction from the pen stroke coordinates to the ruler tool, determine the perpendicular line between the pen stroke coordinates and the straight line where the ruler tool is located, and determine the intersection of the perpendicular line and the straight line where the ruler tool is located as the projection point, and determine the coordinates of the projection point on the current screen as the projection coordinates.
[0076] S303, offset compensation is performed on the projection coordinates based on the drawing width to obtain the projection correction coordinates corresponding to the stroke coordinates.
[0077] Offset the projection coordinates by a distance from the drawing width along the direction from the stroke coordinates to the ruler tool, and adjust the projection coordinates corresponding to the stroke coordinates.
[0078] Please see Figure 4 , Figure 4 A schematic diagram of the interface after pen stroke coordinate projection correction. Figure 4 The coordinates of the sampling point are the original touch coordinates of the stylus on the current screen, and the coordinates of the projection point are the projection correction coordinates after projection and offset compensation of the touch coordinates. It can be seen that after projection compensation, the projection point can fit exactly with the ruler edge baseline.
[0079] In this embodiment, the pen stroke coordinates are vertically projected onto the edge of the ruler tool to regulate and constrain the original messy pen stroke coordinates, so that the touch points uniformly conform to the ruler edge baseline. Then, the projected coordinates are offset and compensated based on the drawing width corresponding to the stylus, which cancels the drawing offset error caused by the thickness of the stylus itself. This effectively avoids defects such as skewed lines, drawing overflow, and poor fit, ensuring the compatibility of multiple stylus types and the drawing accuracy of stylus of different thicknesses, and greatly improving the regularity and adaptability of the ruler tool for assisted drawing.
[0080] When using the stylus to draw on the current screen with the ruler tool, the eraser tool can also be invoked to erase the drawing content on the screen, thereby correcting the drawing information. In an exemplary embodiment, such as... Figure 5 As shown, it also includes:
[0081] S501, in response to the erase operation triggered by the stylus on the current screen, calls the stylus touch processing function to obtain multiple movement trajectory points of the stylus on the current screen.
[0082] It should be noted that the erasing action is usually a continuous erasing trajectory, including multiple trajectory points.
[0083] When the stylus is detected to be switched to eraser mode and a sliding erase operation is performed on the current screen where the ruler tool is displayed, the corresponding eraser processing flow is triggered: a unified pen touch processing function is called to collect the continuous position change data generated by the eraser during the sliding process in real time, obtain multiple continuous movement trajectory points formed by the stylus in the screen coordinate system, and form a complete eraser trajectory sequence.
[0084] S502 processes the erasure path of the erasure action based on the distance between multiple movement trajectory points and the ruler tool.
[0085] Calculate the geometric distance between each movement trajectory point and the ruler tool, and constrain the erasure path based on the distance relationship between the trajectory points and the ruler tool.
[0086] For example, when the distance between the movement trajectory point and the ruler tool is small, that is, when the erasing action is close to the ruler tool, the erasing action is restricted; when the distance between the movement trajectory point and the ruler tool is large, that is, when the erasing action is far from the ruler tool, the erasing action is performed normally.
[0087] In this embodiment, a unified stroke processing function is used to collect continuous movement trajectory points during the erasure process. The geometric distance between each movement trajectory point and the ruler tool is used as the criterion to differentiate and reasonably constrain the overall erasure path. This can specifically distinguish the erasure permissions of the area around the ruler from the ordinary drawing area, avoid the erasure path from indiscriminately covering the screen content, prevent the ruler itself and the regular lines drawn on the ruler from being accidentally erased, and improve the accuracy and stability of drawing and erasure interaction.
[0088] In an exemplary embodiment, the processing method of the erasure path in the foregoing embodiments is further described. Based on the distance between multiple movement trajectory points and the ruler tool, the erasure path of the erasure action is processed, including:
[0089] For any one of the multiple moving trajectory points, if the distance between the moving trajectory point and the ruler is greater than a preset threshold, the erase operation corresponding to the moving trajectory point is filtered out; and if the distance between the moving trajectory point and the ruler is less than or equal to the preset threshold, the erase operation corresponding to the moving trajectory point is executed.
[0090] For any one of the multiple motion trajectory points, if the distance between the motion trajectory point and the ruler is greater than a preset threshold, it indicates that the point is far from the ruler's protection area. The erase operation corresponding to the motion trajectory point is filtered out and discarded, and the erase operation is prohibited. If the distance between the motion trajectory point and the ruler is less than or equal to the preset threshold, it indicates that the point is determined to be within the legal erase range around the ruler. The erase action corresponding to the motion trajectory point is executed normally, and the screen erase rendering is completed.
[0091] In this embodiment, the distance between the moving trajectory point and the ruler is compared with a preset threshold to control the erasing behavior, accurately divide the erasable area and the restricted area, and allow erasing operations within the range of the ruler to take effect. It automatically filters and intercepts long-distance erasing trajectories, realizes fine erasing in the ruler area, and disables accidental erasing in non-ruler areas, thereby enhancing the overall usability of the tool.
[0092] When a ruler tool is currently displayed on the screen, various operations such as dragging, scaling, and rotating can be performed on the current screen or the ruler tool using a stylus. In this case, the display parameters of the ruler tool also need to be adjusted accordingly to ensure the accuracy of the ruler tool. In an exemplary embodiment, at least one of the following is also included:
[0093] In response to a drag instruction for the ruler tool, move the ruler tool to the position corresponding to the drag instruction;
[0094] In response to a rotation instruction for the ruler tool, display an angle gauge on the current screen and rotate the ruler tool according to the indicated angle;
[0095] In response to zooming operations on the current screen, obtain the zoom ratio and adjust the ruler tool's scale spacing based on the zoom ratio.
[0096] The drag instruction can be a drag touch command generated by pressing and sliding the ruler tool with a stylus.
[0097] In the scenario of dragging a ruler tool, the terminal device listens to the touch press and slide events of the ruler tool in real time, recognizes the drag instructions of the user on the ruler tool through the stylus, calculates the difference in horizontal and vertical displacement between the drag starting point and the real-time sliding point to obtain the offset; then, based on the initial coordinates of the ruler tool, the offset is superimposed, and the view coordinates of the ruler tool are refreshed, so that the ruler as a whole smoothly moves along the drag trajectory and finally positions itself at the position corresponding to the drag instruction.
[0098] Rotation indicators can be triggered by a stylus on a ruler through rotation gestures and commands.
[0099] In the scenario of using a rotating ruler tool, when a rotation operation is recognized, a pop-up window is rendered on the current screen to display the angle dashboard; at the same time, the deflection angle change value of the rotation indicator is collected in real time, and the rotation transformation parameters of the ruler are dynamically updated with the center point of the ruler as the rotation reference axis, following the real-time rotation angle parameters, and the placement angle of the ruler is adjusted synchronously so that the ruler completes the deflection adjustment according to the angle indicated by the rotation.
[0100] The zoom operation can be a global canvas zoom gesture that zooms in or out on the current screen.
[0101] In screen scaling scenarios, the terminal device listens to the two-finger scaling interaction on the current screen in real time, calculates the ratio of the canvas size before and after scaling, and obtains the real-time global scaling ratio. Then, without changing the overall outer frame size and display size of the ruler, the internal scale layout parameters of the ruler are extracted separately, and the pixel interval between the scales is linearly calculated according to the scaling ratio: if the canvas is enlarged, the scale interval is increased; if the canvas is shrunk, the scale interval is narrowed, thus completing the adaptive adjustment of the ruler scale.
[0102] In this embodiment, the ruler can be freely moved by responding to drag instructions, and the ruler's angle can be precisely adjusted based on rotation instructions and the angle gauge. At the same time, the scale spacing is adaptively adjusted according to the scaling ratio when the canvas is zoomed. The control capabilities of the ruler tool are improved in multiple dimensions. It can flexibly adapt to the auxiliary drawing needs of different drawing positions and tilt angles. The angle gauge improves the intuitiveness and accuracy of rotation adjustment. It can also ensure that the scale display is neat and readable in the canvas zooming scene. Overall, the interactive flexibility, scene adaptability and drawing auxiliary practicality of the ruler tool are optimized.
[0103] In one exemplary embodiment, it further includes:
[0104] In response to the ruler tool display action triggered in the current screen, the ruler display function is called to create the ruler tool and float it in the current screen; the length of the ruler tool is n times the current screen length, where n is a positive number greater than 1.
[0105] In response to user actions such as invoking or displaying the ruler tool on the current drawing interface, the system calls a pre-defined ruler display function to create an instance of the ruler tool view and initialize its parameters. The generated ruler tool is then rendered as a floating layer overlaid on the current screen, without obscuring the underlying canvas drawing content. It's important to emphasize that the ruler tool is displayed floatingly on the current screen, no longer limited to a single PDF page or canvas.
[0106] In addition, the fixed length parameter of the ruler tool is predetermined to be n times the current screen display length, where n is a positive number greater than 1, for example, n is 4, so that the overall size of the ruler is larger than the visible range of the screen.
[0107] Please see Figure 6 , Figure 6 This is a schematic diagram of the interface of a ruler tool in one embodiment, including a ruler, a stylus, and a dashboard. The ruler is displayed on the screen in a semi-transparent manner, and the dashboard is superimposed on the ruler, displaying the rotation angle of the ruler relative to the horizontal axis of the screen. Figure 6 The angle is shown as 33°. By drawing on the edge of the ruler with a stylus, you can see that the stylus strokes are absorbed by the edge of the ruler.
[0108] In this embodiment, a ruler tool can be quickly created and floated by triggering a display action. The method of invocation is simple and convenient, the interface hierarchy is independent, and it does not interfere with the underlying normal drawing operations. Furthermore, setting the ruler length to a multiple of the screen size avoids boundary limitations caused by insufficient ruler length during drawing, meeting the needs of drawing long lines and continuous cross-regional drawing. It eliminates the need for frequent dragging and adjustment of the ruler position, effectively expanding the auxiliary drawing range and improving the continuity and efficiency of the ruler tool.
[0109] In one exemplary embodiment, a custom ruler tool is provided, including a singleton class `MERulerTool` and a ruler view class `MERulerView`. `MERulerTool` is responsible for the overall management of the ruler, including but not limited to display, dismissal, zoom updates, touch filtering, eraser path restrictions, and dynamic parameter adjustment. `MERulerView` is responsible for the ruler's drawing, gesture interaction processing, and angle dashboard display, supporting core functions such as semi-transparent backgrounds, dynamic scale drawing, and drag-and-rotate functionality.
[0110] The ruler tool contains several core functions, including but not limited to: ruler creation and display function (show), scale adaptive scaling function (updateScale), touch point filtering and conversion function (filterToNewPoint), method swapping function (swizzle), and background event pass-through view function (BackgroundPassThroughView).
[0111] In the application scenario of the ruler tool, the ruler is drawn with a semi-transparent background in any UIView container using the show method, and an extra-long ruler (usually 4 times the width of the canvas) is floated to avoid obscuring the drawing content below.
[0112] Background events are passed through using BackgroundPassThroughView, which supports floating layer display and does not intercept events from the underlying layer.
[0113] The updateScale method adjusts the scale spacing, scale density, length, and transparency in real time according to the canvas scaling ratio to achieve the true pixel ratio of A4 paper (210mm wide).
[0114] Contact handling is compatible with both system pens and custom pens through method swizzling;
[0115] The `filterToNewPoint` method is used to project and calculate the touch point, offset by the pen width / 2, to achieve precise edge snapping. At the same time, path restriction logic is added for the eraser tool, such as allowing erasing when the touch point is close to the ruler edge, or filtering out erasing points that are off-edge.
[0116] In addition, the ruler tool also integrates a pan gesture recognizer (UIPanGestureRecognizer), which has a boundary safety correction mechanism, a rotation gesture recognizer (UIRotationGestureRecognizer), and an angle dashboard view (MEAngleDialView), which enables the display of the angle dashboard and dynamic adjustment of layer anchor points when rotating.
[0117] In the application scenarios of the ruler tool, it supports dynamic parameter adjustment interfaces, such as adjusting the scale accuracy, the gap between the line segment edge and the ruler edge, etc.; it supports dragging UIPanGestureRecognizer and rotating UIRotationGestureRecognizer; when rotating, it displays the angle dashboard MEAngleDialView and dynamically adjusts the layer anchor points.
[0118] In summary, deploying the ruler tool provided in this application embodiment on a terminal device enables functions such as a floating ruler, real-time scaling of the scale, compatibility with multiple pen strokes, eraser path limitation, and dynamic parameter adjustment, which is significantly superior to the system's built-in ruler. Users can intuitively experience various optimized functions in the software interface, improving the efficiency and accuracy of drawing and annotation.
[0119] In one exemplary embodiment, a method for assisting in the operation of a ruler tool is provided, applied to a terminal device, the method comprising the following steps:
[0120] (1) In response to the ruler tool display action triggered in the current screen, call the ruler display function to create the ruler tool and display the ruler tool floating in the current screen.
[0121] The length of the ruler tool is n times the current screen size, where n is a positive number greater than 1.
[0122] (2) In response to the pen stroke action triggered by the stylus on the current screen, obtain the pen stroke coordinates on the current screen, wherein a ruler tool is displayed on the current screen.
[0123] (3) Call the unified pen stroke processing function to obtain the drawing width corresponding to the stylus, and project the pen stroke coordinates vertically onto the edge of the ruler tool to obtain the projection coordinates.
[0124] (4) Based on the drawing width, offset compensation is performed on the projection coordinates to obtain the projection correction coordinates corresponding to the stroke coordinates.
[0125] (5) Call the drawing function that matches the type of stylus and correct the coordinates according to the projection to perform the operation function of the stylus on the ruler tool.
[0126] (6) In response to the erase operation triggered by the stylus on the current screen, call the stylus touch processing function to obtain multiple movement trajectory points of the stylus on the current screen.
[0127] (7) For any one of the multiple moving trajectory points, if the distance between the moving trajectory point and the ruler is greater than a preset threshold, filter the erasure operation corresponding to the moving trajectory point; and if the distance between the moving trajectory point and the ruler is less than or equal to the preset threshold, execute the erasure operation corresponding to the moving trajectory point.
[0128] (8) In response to a drag instruction for the ruler tool, move the ruler tool to the position corresponding to the drag instruction.
[0129] (9) In response to a rotation instruction for the ruler tool, display an angle gauge on the current screen and rotate the ruler tool according to the angle indicated by the rotation instruction.
[0130] (10) In response to a zoom operation on the current screen, obtain the zoom ratio and adjust the scale spacing of the ruler tool based on the zoom ratio.
[0131] The ruler tool in this embodiment can be used to replace the ruler drawing aid in the system's native drawing framework, and has the following advantages:
[0132] ① Enhanced compatibility: Through method exchange technology, it deeply integrates with the system's native drawing framework, supporting both the system's native pens and third-party custom pens and brushes. It also solves the problem that third-party rulers cannot constrain the system's native handwriting, avoiding a fragmented user experience.
[0133] ② It has a wider range of applications. By using BackgroundPassThroughView to achieve floating layer display, the ruler can float on the top layer of the entire application interface, without being limited by a single PDF page or canvas boundary. It supports scenarios such as multi-page PDF annotation and cross-page drawing, and achieves continuous assistance.
[0134] ③ More precise scaling adaptation: The updateScale method responds to the canvas scaling ratio in real time and dynamically adjusts the scale spacing to strictly correspond to the actual size of A4 paper (210mm wide), allowing users to accurately control the drawing ratio at different scaling levels and improve drawing accuracy.
[0135] ④ The erasing operation is more precise. The new eraser path restriction function can constrain the movement trajectory of the eraser through the filter point mechanism or edge adsorption, allowing erasing only along the edge of the ruler or near the edge area, effectively avoiding misoperation, improving erasing accuracy and efficiency.
[0136] ⑤ It offers greater flexibility and supports dynamic adjustment of parameters, such as pen width offset, snap trigger distance, scale display density, and eraser path filtering threshold, which can be adjusted in real time or dynamically in configuration to adapt to different pen types and scaling levels. It can flexibly adapt to different pen types, scaling levels, and usage scenarios to meet diverse drawing needs.
[0137] ⑥ Enhanced interactive experience: integrates single-finger drag and two-finger rotation gestures, displays an angle dashboard during rotation, provides real-time feedback on the rotation angle, and dynamically adjusts layer anchor points and boundary safety corrections to ensure smooth operation and visual stability. The semi-transparent ruler background also prevents it from obscuring the drawing content below.
[0138] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0139] Based on the same inventive concept, this application also provides an operating aid device for a ruler tool to implement the above-described operating aid method. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations of one or more operating aid device embodiments of a ruler tool provided below can be found in the limitations of the operating aid method for a ruler tool described above, and will not be repeated here.
[0140] In one exemplary embodiment, such as Figure 7 As shown, an operation assistance device for a ruler tool is provided, including: a coordinate acquisition module 701, a coordinate projection module 702, and an operation assistance module 703, wherein:
[0141] The coordinate acquisition module 701 is used to obtain the pen stroke coordinates of the stylus in the current screen in response to the pen stroke action triggered by the stylus in the current screen, wherein a ruler tool is displayed in the current screen.
[0142] The coordinate projection module 702 is used to call a unified stroke processing function to project the stroke coordinates onto the edge of the ruler tool, obtaining the projection correction coordinates required for the stroke coordinates; and
[0143] The operation assistance module 703 is used to call the drawing function that matches the type of stylus and correct the coordinates according to the projection to perform the operation function of the stylus on the ruler tool.
[0144] In an exemplary embodiment, the coordinate projection module 702 includes: a width acquisition unit, an edge snapping unit, and a width compensation unit, wherein:
[0145] The width acquisition unit is used to call the pen touch processing function to obtain the drawing width corresponding to the stylus;
[0146] An edge snapping unit is used to vertically project the stroke coordinates onto the edge of the ruler tool to obtain the projected coordinates; and
[0147] The width compensation unit is used to offset the projection coordinates based on the drawing width to obtain the projection correction coordinates corresponding to the stroke coordinates.
[0148] In one exemplary embodiment, the ruler tool operation aid further includes: an erasure trajectory point acquisition module and a path constraint module, wherein:
[0149] The erase trajectory point acquisition module is used to respond to the erase operation triggered by the stylus on the current screen by calling the stylus touch processing function to obtain multiple movement trajectory points of the stylus on the current screen; and
[0150] The path constraint module is used to process the erasure path of the erasure action based on the distance between multiple movement trajectory points and the ruler tool.
[0151] In an exemplary embodiment, the path constraint module includes: a trajectory point filtering unit and an erasure execution unit, wherein:
[0152] The trajectory point filtering unit is used to filter the erasure operation corresponding to any one of multiple moving trajectory points if the distance between the moving trajectory point and the ruler is greater than a preset threshold; and
[0153] The erasure execution unit is used to perform the erasure operation corresponding to the moving trajectory point when the distance between the moving trajectory point and the ruler is less than or equal to a preset threshold.
[0154] In one exemplary embodiment, the ruler tool operation aid further includes: a ruler dragging module, a ruler rotation module, and a ruler scaling module, wherein:
[0155] The ruler drag module is used to move the ruler tool to the position corresponding to the drag instruction in response to the drag instruction.
[0156] The ruler rotation module is used to display an angle gauge on the current screen in response to a rotation instruction for the ruler tool, and to rotate the ruler tool according to the angle indicated by the rotation instruction;
[0157] The ruler scaling module is used to respond to scaling operations on the current screen, obtain the scaling ratio, and adjust the scale spacing of the ruler tool based on the scaling ratio.
[0158] In an exemplary embodiment, the ruler tool operation assistance device further includes: a ruler display module, configured to, in response to a ruler tool display action triggered on the current screen, call a ruler display function to create a ruler tool and float and display the ruler tool on the current screen; wherein the length of the ruler tool is n times the current screen length, where n is a positive number greater than 1.
[0159] The various modules in the aforementioned ruler tool operation aid device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0160] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein when executed by the processor, a computer program is configured to perform the following steps:
[0161] In response to a stylus stroke triggered on the current screen, obtain the stylus stroke coordinates on the current screen, where a ruler tool is displayed on the current screen;
[0162] Calling a unified stroke processing function projects the stroke coordinates onto the edge of the ruler tool, obtaining the required projection correction coordinates for the stroke coordinates; and
[0163] Call the drawing function that matches the type of stylus to correct the coordinates according to the projection, and perform the stylus operation function on the ruler tool.
[0164] In one embodiment, the computer program is further configured to perform the following steps:
[0165] Call the pen touch processing function to obtain the drawing width corresponding to the stylus;
[0166] Project the stroke coordinates vertically onto the edge of the ruler tool to obtain the projected coordinates; and
[0167] The projection coordinates are offset and compensated based on the drawing width to obtain the projection correction coordinates corresponding to the stroke coordinates.
[0168] In one embodiment, the computer program is further configured to perform the following steps:
[0169] In response to an erase operation triggered by the stylus on the current screen, the stylus touch processing function is called to obtain multiple movement trajectory points of the stylus on the current screen; and
[0170] The erasure path of the erasure action is processed based on the distance between multiple movement trajectory points and the ruler tool.
[0171] In one embodiment, the computer program is further configured to perform the following steps:
[0172] For any one of multiple movement trajectory points, if the distance between the movement trajectory point and the ruler is greater than a preset threshold, the erase operation corresponding to that movement trajectory point is filtered out; and
[0173] If the distance between the moving trajectory point and the ruler is less than or equal to a preset threshold, the erase operation corresponding to the moving trajectory point is executed.
[0174] In one embodiment, the computer program is further configured to perform the following steps:
[0175] In response to a drag instruction for the ruler tool, move the ruler tool to the position corresponding to the drag instruction;
[0176] In response to a rotation instruction for the ruler tool, display an angle gauge on the current screen and rotate the ruler tool according to the indicated angle;
[0177] In response to zooming operations on the current screen, obtain the zoom ratio and adjust the ruler tool's scale spacing based on the zoom ratio.
[0178] In one embodiment, the computer program is further configured to perform the following steps:
[0179] In response to a ruler tool display action triggered in the current screen, the ruler display function is called to create a ruler tool, which is then floated and displayed in the current screen. The length of the ruler tool is n times the current screen size, where n is a positive number greater than 1.
[0180] In one embodiment, a computer-readable storage medium is provided, wherein when executed by a processor, a computer program is configured to perform the following steps:
[0181] In response to a stylus stroke triggered on the current screen, obtain the stylus stroke coordinates on the current screen, where a ruler tool is displayed on the current screen;
[0182] Calling a unified stroke processing function projects the stroke coordinates onto the edge of the ruler tool, obtaining the required projection correction coordinates for the stroke coordinates; and
[0183] Call the drawing function that matches the type of stylus to correct the coordinates according to the projection, and perform the stylus operation function on the ruler tool.
[0184] In one embodiment, the computer program is further configured to perform the following steps:
[0185] Call the pen touch processing function to obtain the drawing width corresponding to the stylus;
[0186] Project the stroke coordinates vertically onto the edge of the ruler tool to obtain the projected coordinates; and
[0187] The projection coordinates are offset and compensated based on the drawing width to obtain the projection correction coordinates corresponding to the stroke coordinates.
[0188] In one embodiment, the computer program is further configured to perform the following steps:
[0189] In response to an erase operation triggered by the stylus on the current screen, the stylus touch processing function is called to obtain multiple movement trajectory points of the stylus on the current screen; and
[0190] The erasure path of the erasure action is processed based on the distance between multiple movement trajectory points and the ruler tool.
[0191] In one embodiment, the computer program is further configured to perform the following steps:
[0192] For any one of multiple movement trajectory points, if the distance between the movement trajectory point and the ruler is greater than a preset threshold, the erase operation corresponding to that movement trajectory point is filtered out; and
[0193] If the distance between the moving trajectory point and the ruler is less than or equal to a preset threshold, the erase operation corresponding to the moving trajectory point is executed.
[0194] In one embodiment, the computer program is further configured to perform the following steps:
[0195] In response to a drag instruction for the ruler tool, move the ruler tool to the position corresponding to the drag instruction;
[0196] In response to a rotation instruction for the ruler tool, display an angle gauge on the current screen and rotate the ruler tool according to the indicated angle;
[0197] In response to zooming operations on the current screen, obtain the zoom ratio and adjust the ruler tool's scale spacing based on the zoom ratio.
[0198] In one embodiment, the computer program is further configured to perform the following steps:
[0199] In response to a ruler tool display action triggered in the current screen, the ruler display function is called to create a ruler tool, which is then floated and displayed in the current screen. The length of the ruler tool is n times the current screen size, where n is a positive number greater than 1.
[0200] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0201] In response to a stylus stroke triggered on the current screen, obtain the stylus stroke coordinates on the current screen, where a ruler tool is displayed on the current screen;
[0202] Calling a unified stroke processing function projects the stroke coordinates onto the edge of the ruler tool, obtaining the required projection correction coordinates for the stroke coordinates; and
[0203] Call the drawing function that matches the type of stylus to correct the coordinates according to the projection, and perform the stylus operation function on the ruler tool.
[0204] In one embodiment, the computer program is further configured to perform the following steps:
[0205] Call the pen touch processing function to obtain the drawing width corresponding to the stylus;
[0206] Project the stroke coordinates vertically onto the edge of the ruler tool to obtain the projected coordinates; and
[0207] The projection coordinates are offset and compensated based on the drawing width to obtain the projection correction coordinates corresponding to the stroke coordinates.
[0208] In one embodiment, the computer program is further configured to perform the following steps:
[0209] In response to an erase operation triggered by the stylus on the current screen, the stylus touch processing function is called to obtain multiple movement trajectory points of the stylus on the current screen; and
[0210] The erasure path of the erasure action is processed based on the distance between multiple movement trajectory points and the ruler tool.
[0211] In one embodiment, the computer program is further configured to perform the following steps:
[0212] For any one of multiple movement trajectory points, if the distance between the movement trajectory point and the ruler is greater than a preset threshold, the erase operation corresponding to that movement trajectory point is filtered out; and
[0213] If the distance between the moving trajectory point and the ruler is less than or equal to a preset threshold, the erase operation corresponding to the moving trajectory point is executed.
[0214] In one embodiment, the computer program is further configured to perform the following steps:
[0215] In response to a drag instruction for the ruler tool, move the ruler tool to the position corresponding to the drag instruction;
[0216] In response to a rotation instruction for the ruler tool, display an angle gauge on the current screen and rotate the ruler tool according to the indicated angle;
[0217] In response to zooming operations on the current screen, obtain the zoom ratio and adjust the ruler tool's scale spacing based on the zoom ratio.
[0218] In one embodiment, the computer program is further configured to perform the following steps:
[0219] In response to a ruler tool display action triggered in the current screen, the ruler display function is called to create a ruler tool, which is then floated and displayed in the current screen. The length of the ruler tool is n times the current screen size, where n is a positive number greater than 1.
[0220] It should be noted that the equipment information and data involved in this application (including but not limited to data used for analysis, data stored, data displayed, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0221] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0222] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0223] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for assisting in the operation of a ruler tool, characterized in that, Applied to a terminal device, the method includes: In response to a pen stroke triggered by a stylus on the current screen, the pen stroke coordinates of the stylus on the current screen are obtained, wherein a ruler tool is displayed on the current screen; Calling a unified stroke processing function projects the stroke coordinates onto the edge of the ruler tool, obtaining the required projection correction coordinates for the stroke coordinates; and The drawing function matching the type of the stylus is invoked to perform the operation function of the stylus on the ruler tool according to the projection correction coordinates.
2. The method according to claim 1, characterized in that, The process of calling a unified stroke processing function to project the stroke coordinates onto the edge of the ruler tool to obtain the required projection correction coordinates for the stroke coordinates includes: Call the pen touch processing function to obtain the drawing width corresponding to the stylus; The pen stroke coordinates are vertically projected onto the edge of the ruler tool to obtain the projected coordinates; and Based on the drawing width, the projection coordinates are offset and compensated to obtain the projection correction coordinates corresponding to the stroke coordinates.
3. The method according to claim 1 or 2, characterized in that, Also includes: In response to an erase operation triggered by the stylus on the current screen, the stylus touch processing function is called to obtain multiple movement trajectory points of the stylus on the current screen; as well as The erasure path of the erasure action is processed based on the distance between the multiple movement trajectory points and the ruler tool.
4. The method according to claim 3, characterized in that, The process of processing the erasure path of the erasure action based on the distance between the plurality of movement trajectory points and the ruler tool includes: For any of the plurality of movement trajectory points, if the distance between the movement trajectory point and the ruler is greater than a preset threshold, the erasure operation corresponding to the movement trajectory point is filtered out; and If the distance between the moving trajectory point and the ruler is less than or equal to the preset threshold, the erasure operation corresponding to the moving trajectory point is performed.
5. The method according to claim 1 or 2, characterized in that, It also includes at least one of the following: In response to a drag instruction for the ruler tool, the ruler tool is moved to the position corresponding to the drag instruction; In response to a rotation instruction for the ruler tool, an angle gauge is displayed on the current screen, and the ruler tool is rotated according to the angle indicated by the rotation instruction. In response to a zoom operation on the current screen, a zoom ratio is obtained, and the scale spacing of the ruler tool is adjusted based on the zoom ratio.
6. The method according to claim 1 or 2, characterized in that, Also includes: In response to a ruler tool display action triggered in the current screen, the ruler display function is called to create the ruler tool, and the ruler tool is displayed floating in the current screen; The length of the ruler tool is n times the current screen size, where n is a positive number greater than 1.
7. An auxiliary device for operating a ruler tool, characterized in that, include: The coordinate acquisition module is used to acquire the pen stroke coordinates of the stylus in the current screen in response to the pen stroke action triggered by the stylus in the current screen, wherein a ruler tool is displayed in the current screen; The coordinate projection module is used to call a unified stroke processing function to project the stroke coordinates onto the edge of the ruler tool, thereby obtaining the required projection correction coordinates for the stroke coordinates; and The operation assistance module is used to call a drawing function that matches the type of the stylus and perform the operation function of the stylus on the ruler tool according to the projection correction coordinates.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When executed by the processor, the computer program is used to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program is used to implement the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program is used to implement the method according to any one of claims 1 to 6.