Ruler and compass tool using method, electronic equipment and storage medium

By implementing multi-functional ruler tool operation on electronic devices, and using user operations between the vernier and the ruler to automatically fill in line segments, the problem of single functions of the existing ruler tool is solved, and the drawing efficiency and user experience are improved.

CN120335702APending Publication Date: 2025-07-18HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410040096.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-10
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

The ruler tool on existing electronic devices has a single function and is inconvenient to operate, lacking versatility and convenience.

Method used

It provides a method of using ruler tool, by displaying ruler on the user interface of an electronic device, automatically fills the line segments with user operations between the first verb and the second verb, supports straight line and curve drawing, rotation angle adjustment, and zoom functions, and realizes multi-function ruler tool operation.

Benefits of technology

Improve the efficiency and user experience of the ruler tool, and users can quickly draw line segments of specific lengths and angles, saving operation steps.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120335702A_ABST
    Figure CN120335702A_ABST
Patent Text Reader

Abstract

The invention provides a ruler tool using method, electronic equipment and a storage medium. The electronic equipment displays a first user interface of the first application, and a scale icon is displayed on the first user interface; the electronic equipment receives a first operation of a user for the scale icon, a first scale is displayed on the first user interface, and the first scale comprises a first vernier and a second vernier; the electronic equipment receives a second operation aiming at the first scale; in response to the second operation, the electronic equipment determines whether the second operation is a user operation acting between the first vernier and the second vernier; under the condition that it is determined that the second operation is the user operation acting between the first vernier and the second vernier, the electronic equipment displays a first line segment on the first user interface, and the length of the first line segment is equal to the length of the distance between the first vernier and the second vernier. According to the method, the use efficiency of the inner ruler tool is improved, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of terminals, and particularly to a method for using a ruler and compass tool, an electronic device, and a storage medium. Background Art

[0002] With the development of electronic device technology, more and more applications are installed on electronic devices. Users can watch movies and TV shows, listen to music, navigate routes, or work through the applications installed on the electronic device.

[0003] For example, users can record text notes through the applications installed on the electronic device, and users can also conveniently draw graphics, angles, line segments, etc. through the ruler and compass tool provided by the applications installed on the electronic device. Currently, the functions of the ruler and compass tools provided by applications on electronic devices are relatively single and the operations are inconvenient. How to provide a method for using a ruler and compass tool with multiple functions and convenience remains to be further studied. Summary of the Invention

[0004] This application provides a method for using a ruler and compass tool, an electronic device, and a storage medium, providing a method for using a ruler and compass tool with multiple functions, improving the usage efficiency of the ruler and compass tool in the application, and improving the user experience.

[0005] In a first aspect, this application provides a method for using a ruler and compass tool. The method includes: the electronic device displays a first user interface of a first application, and a ruler icon is displayed on the first user interface; the electronic device receives a first operation of the user on the ruler icon, and a first ruler is displayed on the first user interface, and the first ruler includes a first cursor and a second cursor; the electronic device receives a second operation on the first ruler; in response to the second operation, the electronic device determines whether the second operation is a user operation acting between the first cursor and the second cursor; in the case where it is determined that the second operation is a user operation acting between the first cursor and the second cursor, the electronic device displays a first line segment on the first user interface, and the length of the first line segment is equal to the distance length between the first cursor and the second cursor.

[0006] Optionally, scales and scale values are displayed on the first ruler.

[0007] Optionally, between the first cursor and the second cursor may refer to the connecting line where the first cursor points to the second cursor.

[0008] Optionally, the second operation being a user operation acting between the first cursor and the second cursor may mean that the starting position of the second operation is on the connecting line between the first cursor and the second cursor, and the ending position of the second operation is also on the connecting line between the first cursor and the second cursor. Or, all or most of the trajectory of the second operation is located on the connecting line between the first cursor and the second cursor.

[0009] Through this method, the electronic device can use the first cursor and the second cursor on the first scale to automatically complete the line segment between the first cursor and the second cursor based on the user operation acting between the first cursor and the second cursor, achieving the quick drawing of a line segment with a specific length, which is equal to the distance between one cursor and the second cursor, saving the user's operation.

[0010] Combined with the first aspect, in a possible implementation, the second operation is a sliding operation along the first scale; the method further includes: when it is determined that the second operation is not a user operation acting between the first cursor and the second cursor, the electronic device displays a second line segment on the first user interface, and the length of the second line segment is equal to the length of the sliding trajectory of the second operation.

[0011] Optionally, the second operation not being a user operation acting between the first cursor and the second cursor may mean that the starting position of the second operation is not on the connection line between the first cursor and the second cursor, or the ending position of the second operation is not on the connection line between the first cursor and the second cursor, or all or most of the trajectory of the second operation is not on the connection line between the first cursor and the second cursor.

[0012] Combined with the first aspect, in a possible implementation, the second operation includes any one of the following: an operation of drawing a second line segment between the first cursor and the second cursor, where the length of the second line segment is less than the length of the first line segment, or a click operation between the first cursor and the second cursor.

[0013] In this way, the user can obtain the line segment between the first cursor and the second cursor without sliding along the first scale from the first cursor to the second cursor, saving the user's operation.

[0014] Combined with the first aspect, in a possible implementation, the first scale includes a first line and a second line, the first line is used to draw a straight line on the first user interface, and the second line is used to draw a curve on the first user interface.

[0015] In this way, the user can not only draw a straight line through the first scale but also draw a curve through the first scale.

[0016] Combined with the first aspect, in a possible implementation, the second operation is a sliding operation along the first line on the first scale.

[0017] Combined with the first aspect, in a possible implementation, a first number is displayed above the second cursor, and the first number is used to indicate the distance length between the first cursor and the second cursor. In this way, the user can view the distance length between the first cursor and the second cursor in real time.

[0018] In combination with the first aspect, in a possible implementation, the method further includes: the electronic device receives a third operation of the user on the second cursor; in response to the third operation, the electronic device overlays and displays the first cursor and the second cursor.

[0019] In this way, the user can overlay and display the first cursor and the second cursor, and the electronic device stops the function of automatically completing the line segment between the first cursor and the second cursor, enabling the user to draw a line segment of any length along the first scale.

[0020] In combination with the first aspect, in a possible implementation, after the electronic device overlays and displays the first cursor and the second cursor, the method further includes: the electronic device displays a first prompt message above the first cursor, and the first prompt message is used to indicate that the automatic completion of the line segment between the first cursor and the second cursor has stopped.

[0021] In combination with the first aspect, in a possible implementation, the first scale includes a first angle disc, and a second number is displayed on the first angle disc, and the second number is used to indicate the included angle between the first scale and the first reference line.

[0022] In this way, the user can view the included angle between the first scale and the first reference line through the second number to determine the orientation of the first scale.

[0023] In combination with the first aspect, in a possible implementation, the first reference line is parallel to the horizontal line. Optionally, not limited to the first reference line being parallel to the horizontal line, the first reference line can also be other reference lines, and the present application does not limit this.

[0024] In combination with the first aspect, in a possible implementation, the method further includes: the electronic device receives a fourth operation of the user on the first angle disc; in response to the fourth operation, the electronic device displays a second angle disc, and the second angle disc includes a plurality of angle values; the electronic device receives a fifth operation of the user on a first angle value among the plurality of angle values; in response to the fifth operation, the electronic device rotates the first scale along a first direction by the first angle value on the basis of the first reference line.

[0025] In this way, the user can rotate the first scale to change the orientation of the first scale.

[0026] In combination with the first aspect, in a possible implementation, after the electronic device rotates the first scale along the first direction by the first angle value on the basis of the first reference line, the method further includes: the electronic device receives a user operation to move the first scale to the starting point of a first line segment; the electronic device receives a user operation to draw along the first scale from the starting point of the first line segment and displays a third line segment on the first user interface, where the included angle between the third line segment and the first reference line is the first angle value.

[0027] In this way, the user can rotate the first scale to change the orientation of the first scale and draw a specific angle.

[0028] In combination with the first aspect, in a possible implementation, the method further includes: the electronic device receives a sixth operation of the user on the first angle disc; in response to the sixth operation, the electronic device displays a second angle disc, which includes a plurality of angle values and a first option; the electronic device receives a seventh operation of the user on the first option; in response to the seventh operation, the electronic device sets the first line segment as the second reference line; the electronic device receives an eighth operation of the user on a second angle value among the plurality of angle values; in response to the eighth operation, the electronic device rotates the first scale along a second direction by the second angle value on the basis of the second reference line.

[0029] In combination with the first aspect, in a possible implementation, after the electronic device rotates the first scale along the second direction by the second angle value on the basis of the second reference line, the method further includes: the electronic device receives a user operation to move the first scale to the starting point of the first line segment; the electronic device receives a user operation to draw along the first scale from the starting point of the first line segment and displays a fourth line segment on the first user interface, where the included angle between the fourth line segment and the second reference line is the second angle value.

[0030] The rotation of the first scale by the electronic device is obtained by rotating on the basis of a reference line. Generally, the reference line is fixed. For example, the default reference line can be parallel to the horizontal line. Through this method, the electronic device can use any line segment as the reference line based on the user operation, that is, change the reference line, and rotate a certain angle on the basis of the new reference line to achieve the convenient drawing of any angle by the electronic device.

[0031] In combination with the first aspect, in a possible implementation, when the second number is 0, the second reference line is the same as the first reference line; when the second number is not 0, the second reference line is different from the first reference line.

[0032] In combination with the first aspect, in a possible implementation, the method further includes: the electronic device receives a ninth operation of the user to reduce the first user interface by a first ratio; in response to the ninth operation, the electronic device also reduces the first scale by the first ratio; or, the electronic device receives a tenth operation of the user to enlarge the first user interface by a second ratio; in response to the tenth operation, the electronic device also enlarges the first scale by the second ratio.

[0033] In this way, the user can scale the first user interface, and the size of the corresponding first scale will also be scaled accordingly. Since the first scale displays scales, the scales displayed on the first scale will also be scaled correspondingly, ensuring that the length of the line segment displayed on the first user interface remains unchanged before and after scaling.

[0034] In a second aspect, the present application provides an electronic device, including one or more processors and one or more memories; wherein, the one or more memories are coupled to the one or more processors, and the one or more memories are configured to store computer program code, the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, a method for using a ruler and compass tool in one of the possible implementation manners of any one of the above aspects is performed.

[0035] In a third aspect, an embodiment of the present application provides a computer storage medium, including computer instructions, and when the computer instructions run on an electronic device, a communication device is enabled to perform a method for using a ruler and compass tool in one of the possible implementation manners of any one of the above aspects.

[0036] In a fourth aspect, an embodiment of the present application provides a computer program product, and when the computer program product runs on a computer, the computer is enabled to perform a method for using a ruler and compass tool in one of the possible implementation manners of any one of the above aspects.

[0037] For the beneficial effects of the second aspect to the fourth aspect, reference may be made to the description of the beneficial effects in the first aspect, and the present application will not elaborate herein. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figures 1A - 1D A schematic diagram showing an electronic device 100 displaying a first scale in a first application;

[0039] Figures 2A - 2D A schematic diagram of the electronic device 100 receiving a user operation to move the first scale 1202 or move the user interface;

[0040] Figures 3A - 3D A schematic diagram of the electronic device 100 receiving a user operation to zoom the user interface;

[0041] Figures 4A - 4L A schematic diagram of the electronic device 100 receiving a user operation to draw a straight line or a curve;

[0042] Figures 5A - 5I A schematic diagram showing the electronic device 100 rotating the first scale 1202 based on a user operation;

[0043] Figures 6A - 6I A schematic diagram showing the electronic device 100 quickly drawing a specific angle through the first scale 1202;

[0044] Figure 7 A schematic diagram of the method flow of a method for using a ruler and compass tool provided by the present application;

[0045] Figure 8 A schematic diagram of the hardware structure of the electronic device 100;

[0046] Figure 9 The schematic diagram of the software structure of the electronic device 100 is shown. Specific implementation manners

[0047] Hereinafter, the technical solutions in the embodiments of the present application will be described clearly and in detail with reference to the accompanying drawings. Among them, in the description of the embodiments of the present application, unless otherwise specified, " / " means "or". For example, A / B may mean A or B; "and / or" in the text is only an association relationship describing associated objects, indicating that there can be three relationships. For example, A and / or B may mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "a plurality" means two or more than two.

[0048] Hereinafter, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as implying or suggesting relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of the present application, unless otherwise specified, the meaning of "a plurality" is two or more.

[0049] The term "user interface (UI)" in the following embodiments of the present application is a media interface for interaction and information exchange between an application program or an operating system and a user, and it realizes the conversion between the internal form of information and the form acceptable to the user. The common manifestation form of the user interface is the graphical user interface (GUI), which refers to the user interface related to computer operations displayed in a graphical manner. It can be visual interface elements such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, Widgets, etc. displayed on the display screen of the electronic device.

[0050] The present application provides a method for using a ruler and compass tool. The electronic device 100 can receive operations such as drawing a straight line, drawing a curve, drawing an angle, and drawing a graph by the user using the ruler function provided by the first application.

[0051] The electronic device 100 can receive and respond to the input operation of the user on the ruler icon in the first application, and display a first ruler on the first application interface of the first application. The first ruler includes a first line and a second line. Scale marks are displayed on the first line, and scale marks are also displayed on the second line. The first line is in a straight line shape, and the second line is in a curve shape. The user can draw a straight line of a preset length through the first line, and the user can also draw a curve of a preset length through the second line.

[0052] Optionally, a first cursor and a second cursor are displayed on the first line or the second line of the first scale. The first cursor and the second cursor can move along the scale marks on the first scale to change the distance between the first cursor and the second cursor. The first cursor and the second cursor are used to measure the distance between two points or draw a straight line or a curve of a preset length.

[0053] Optionally, a first disc is displayed on the first scale, and a first angle is displayed on the first disc. The first angle is used to indicate the included angle between the first scale and the horizontal straight line. The electronic device 100 can receive an operation by the user on the first disc, change the included angle between the first scale and the horizontal straight line, and the corresponding angle value displayed on the first disc will also change to prompt the current included angle between the first scale and the horizontal straight line.

[0054] It should be noted that the user input operation mentioned in this application can be an input operation by the user with a stylus, or an input operation by the user's finger, or other input methods, and this application does not limit this.

[0055] Next, the scale function provided by this application will be introduced in combination with different scenarios.

[0056] Display the first scale.

[0057] Figures 1A - 1D FIG. shows a schematic diagram of the electronic device 100 displaying the first scale in the first application.

[0058] Exemplarily, the first application can be a memo application.

[0059] Figure 1A FIG. shows the desktop of the electronic device 100. Application icons of multiple applications are displayed on the desktop of the electronic device 100. For example, a weather application icon, a stock application icon, a calculator application icon, a settings application icon, an email application icon, a music application icon, a video application icon, a browser application icon, a map application icon, a gallery application icon, a memo application icon, a voice assistant application icon, a beauty application icon, etc. A page indicator is also displayed below the multiple application icons to indicate the total number of pages on the desktop and the positional relationship between the currently displayed page and other pages. For example, the desktop can include three pages, and the white dot in the page indicator can indicate that the currently displayed page is the rightmost one of the three pages. Further optionally, there are multiple tray icons (such as a dial application icon, a message application icon, a contacts application icon, a camera application icon) below the page indicator, and the tray icons remain displayed during page switching. Optionally, a status bar is displayed in the upper part of the desktop. The status bar can include: one or more signal strength indicators of mobile communication signals (also known as cellular signals), a battery status indicator, a time indicator, etc.

[0060] Exemplarily, as Figure 1A shown, the electronic device 100 may receive an input operation (such as a click) from the user on the memo application icon on the desktop. In response to the user's input operation, the electronic device 100 may display Figure 1B the user interface 1100 shown. The user interface 1100 is the main interface of the memo application provided in the embodiments of the present application.

[0061] As Figure 1B shown, the user interface 1100 may include historical note information, and the current user has not created a note. The user interface 1100 also includes a to-do item option and a note addition option. Among them, the user can view one or more items that the user needs to process within a period of time through the to-do item option. The user can also create a new note through the note addition option.

[0062] Exemplarily, as Figure 1B shown, the electronic device 100 may receive an input operation (such as a click) from the user on the note addition option. In response to the user's input operation, the electronic device 100 may display Figure 1C the user interface 1200 shown.

[0063] As Figure 1C shown, the user can edit text in the user interface 1200. The user interface 1200 includes multiple editing options, such as a handwriting option, a ruler icon option 1201, a display style edit, an insert picture option, a recording option, and a setting option, etc. The user can use the ruler icon option 1201 to make the electronic device 100 display a first ruler on the user interface 1200, so that the user can use the first ruler to draw a graph on the user interface 1200.

[0064] Exemplarily, as Figure 1C shown, the electronic device 100 may receive an input operation (such as a click) from the user on the ruler icon option 1201 in the user interface 1200. In response to the user's input operation, the electronic device 100 may display Figure 1D the first ruler 1202 shown.

[0065] As Figure 1D shown, the first ruler 1202 includes a first line 1203 and a second line 1204. The first line 1203 is a straight line, and the second line 1204 is a curve. The user can draw a straight line through the first line 1203 of the first ruler 1202, and the user can also draw a curve through the second line 1204 of the first ruler 1202.

[0066] As Figure 1DAs shown, scale marks and scale values are displayed on the first line 1203. A user can draw a line segment of a preset length using the scale marks on the first line 1203.

[0067] It should be noted that Figure 1D The scale values shown are only for the purpose of explaining this application. The scale values displayed on the first line 1203 can also be in other styles, and this application does not limit this.

[0068] Optionally, the unit of the scale can be in millimeters, and the distance between every two scale marks can be 1 millimeter. The unit of the scale can also be other values, and this application does not limit this.

[0069] Optionally, scale marks and scale values can also be displayed on the second line 1204, and this application does not limit this.

[0070] As Figure 1D shown, the first line 1203 also includes a cursor 1205 and a cursor 1206, and the cursor 1205 and the cursor 1206 can be located at the position of the scale value "1". The initial distance between the cursor 1205 and the cursor 1206 is 20 millimeters.

[0071] As Figure 1D shown, the first scale 1202 also displays an angle disc 1207, and the number "0" is displayed on the angle disc 1207, thereby indicating that the angle between the first scale 1202 and the horizontal line is 0 degrees, that is, the first scale 1202 is parallel to the horizontal line.

[0072] Move the first scale or move the user interface.

[0073] Figures 2A - 2D Schematic diagram of the electronic device 100 receiving a user operation to move the first scale 1202 or move the user interface.

[0074] Exemplarily, as Figure 2A shown, the electronic device 100 displays a user interface 2100 and a first scale 1202. The user interface 2100 is similar to the user interface 1200, except that the user interface 2100 further includes an image 2101 drawn by the user, and the image 2101 can be composed of line segment AB, line segment BD, line segment AC, and line segment CD.

[0075] The electronic device 100 can receive a user operation on the first scale 1202 to change the display position of the first scale 1202.

[0076] Optionally, the user operation can be a long press and drag operation on the first scale 1202. The user operation can also be other operations, and this application does not limit this.

[0077] Exemplarily, asFigure 2A As shown, the user can long-press and drag the first scale 1202 so that the first scale 1202 moves towards the top of the electronic device 100. In response to the user operation, the first scale 1202 can be located at Figure 2B the position shown.

[0078] Not limited to dragging the first scale 1202 towards the top of the electronic device 100, the user can also drag the first scale 1202 towards the bottom of the electronic device 100, or the left side or the right side of the electronic device 100 to change the display position of the dragged first scale 1202. This application does not make any limitations in this regard.

[0079] From Figure 2A and Figure 2B it can be seen that when the user drags the first scale 1202, the position of the user interface 2100 does not change, Figure 2B the position of the image 2101 in Figure 2A is the same as the position of the image 2101 in the display screen.

[0080] Optionally, when the user drags the first scale 1202, the angle disc 1207 needs to be located within the display area of the display screen of the electronic device 100, and the edge of the angle disc 1207 cannot exceed the display area of the display screen of the electronic device 100. For example, the edge of the angle disc 1207 cannot be located outside the display area of the display screen of the electronic device 100, so that the user can view the angle between the first scale 1202 and the horizontal line in real time.

[0081] In some embodiments, the user can also drag the user interface 2100 to change the display position of the first scale 1202 in the user interface 2100.

[0082] The electronic device 100 can receive the user operation on the user interface 2100 to change the display position of the user interface 2100.

[0083] Optionally, the user operation can be an operation of long-pressing and dragging the user interface 2100. The user operation can also be other operations. This application does not make any limitations in this regard.

[0084] Exemplarily, as Figure 2C shown, the user can long-press and drag the user interface 2100 so that the user interface 2100 moves towards the top of the electronic device 100. In response to the user operation, the entire user interface 2100 is translated a certain distance towards the top of the electronic device 100, and the user interface 2100 can be located at Figure 2D the position shown. The position of the first scale 1202 remains unchanged, but the display position of the first scale 1202 in the user interface 2100 also changes accordingly.

[0085] Not limited to dragging the user interface 2100 to the top of the electronic device 100, the user can also drag the user interface 2100 to the bottom of the electronic device 100, or to the left or right of the electronic device 100 to change the display position of the first scale 1202 in the user interface 2100, and the present application does not make any limitations thereto.

[0086] By Figure 2C and Figure 2D It can be seen that when the user drags the user interface 2100, the position of the user interface 2100 changes. Figure 2D The position of the image 2101 in the display screen in Figure 2C is different from the position of the image 2101 in the display screen in

[0087] When the user interface is scaled, the first scale 1202 is also scaled proportionally.

[0088] Figures 3A - 3D Schematic diagram of the electronic device 100 receiving a user operation to scale the user interface.

[0089] In some embodiments, the electronic device 100 can receive a user operation to reduce the user interface 1200.

[0090] Exemplarily, as Figure 3A shown, the electronic device 100 can receive a user operation acting on the user interface 1200. In response to the user operation, the electronic device 100 can reduce the user interface 1200 and display Figure 3B the user interface 3100 shown.

[0091] Optionally, the user operation can be a user operation of pinching two fingers towards each other. The user operation can also be other operations, and the present application does not make any limitations thereto.

[0092] Exemplarily, the user interface 3100 can be reduced by a factor of 0.8 based on the user interface 1200. Correspondingly, the size of the image 2101 on the user interface 3100 / the size of the image 2101 on the user interface 1200 = 0.8.

[0093] Optionally, in response to the user operation of reducing the user interface 1200, the size of the first scale 1202 will also be correspondingly reduced, so that the scale shown on the first scale 1202 is also correspondingly reduced. The size of the first scale 1202 on the user interface 3100 / the size of the first scale 1202 on the user interface 1200 = 0.8.

[0094] In some embodiments, the electronic device 100 can receive a user operation to enlarge the user interface 1200.

[0095] Exemplarily, asFigure 3C As shown, the electronic device 100 can receive a user operation acting on the user interface 1200. In response to the user operation, the electronic device 100 can magnify the user interface 1200 and display Figure 3D the user interface 3200 shown.

[0096] Optionally, the user operation can be a user operation of two-finger reverse sliding. The user operation can also be other operations, which are not limited in this application.

[0097] Exemplarily, the user interface 3200 can be magnified 1.3 times based on the user interface 1200. Correspondingly, the size of the image 2101 on the user interface 3200 / the size of the image 2101 on the user interface 1200 = 1.3.

[0098] Optionally, in response to the user operation of magnifying the user interface 1200, the size of the first scale 1202 will also be magnified correspondingly, so that the scale shown on the first scale 1202 is also magnified correspondingly. The size of the first scale 1202 on the user interface 3200 / the size of the first scale 1202 on the user interface 1200 = 1.3.

[0099] Draw a straight line or a curve based on the first scale 1202.

[0100] Figures 4A - 4L Schematic diagram of the electronic device 100 receiving a user operation to draw a straight line or a curve.

[0101] The user can draw a straight line or a curve through the first scale 1202.

[0102] Exemplarily, as Figure 4A shown, the electronic device 100 can receive a sliding operation of the user along the second line 1204 on the first scale 1202, for example, moving from the position A ( Figure 4A the position where the single finger of the solid-line gesture in ) to the position B ( Figure 4A the position where the single finger of the dashed-line gesture in ) on the second line 1204, and then releasing the finger. The electronic device 100 can obtain Figure 4B the curve 4101 shown to implement drawing a curve through the first scale 1202.

[0103] Exemplarily, as Figure 4C shown, the electronic device 100 can receive a sliding operation of the user along the first line 1203 on the first scale 1202, for example, moving from the position C ( Figure 4C the position where the single finger of the solid-line gesture in ) to the position D ( Figure 4Cthe position where the single finger of the dotted-line gesture is located), and then release the finger, the electronic device 100 can obtain Figure 4D the line segment 4102 shown in the figure to draw a straight line through the first scale 1202.

[0104] Based on Figures 4A - 4D the description in the embodiment, when the user draws a straight line or a curve through the first scale 1202, for example, when drawing a straight line of the first length or a curve of the first length, the user needs to move the first length along the first line 1203 or the second line 1204 of the first scale 1202.

[0105] In some embodiments, the user can quickly draw a straight line or a curve through the cursor 1205 and the cursor 1206. For example, when the user needs to draw a line segment of the first length or a curve of the first length, the user can draw a line segment of the second length or a curve of the second length between the cursor 1205 and the cursor 1206, and the second length is less than the first length. The electronic device 100 can automatically complete the line segment with the length between the cursor 1205 and the cursor 1206, and the user does not need to move from the position where the cursor 1205 is located to the position where the cursor 1206 is located, saving the user's operation.

[0106] In some embodiments, the electronic device 100 can display the distance between the cursor 1205 and the cursor 1206 near (such as above) the cursor 1205 or the cursor 1206.

[0107] Exemplarily, as Figure 4E shown in the figure, a number 4103 is displayed above the cursor 1206, and the number 4103 includes the number "20mm", and the number 4103 is used to indicate the distance between the cursor 1205 and the cursor 1206.

[0108] In some embodiments, the electronic device 100 can also display the number 4103 above the cursor 1205, and this application does not make a limitation on this.

[0109] When the user changes the position of the cursor 1205 or the cursor 1206, the number displayed above the cursor 1206 will also change correspondingly.

[0110] Exemplarily, as Figure 4E shown in the figure, the user can move the cursor 1206 from the position E ( Figure 4E the position where the single finger of the solid-line gesture is located in the figure) along the first line 1203 to the position F on the first line 1203 ( Figure 4E the position where the single finger of the dotted-line gesture is located in the figure), and then release the finger, and the electronic device 100 can move the cursor 1206 to Figure 4F the position F shown in the figure.

[0111] In response to moving the cursor 1206 from position E to position F, the distance between the cursor 1205 and the cursor 1206 also changes. The electronic device 100 can display the number 4104 near (e.g., above) the cursor 1206. The number 4104 includes the number "30mm", and the number 4104 is used to indicate the distance between the cursor 1205 and the cursor 1206.

[0112] The user can also quickly draw a line segment between the cursor 1205 and the cursor 1206.

[0113] In a possible implementation, as Figure 4G shown, the electronic device 100 can receive an input operation by the user between the cursor 1205 and the cursor 1206, such as a click operation. In response to the user's input operation, the electronic device 100 can automatically draw a line segment between the cursor 1205 and the cursor 1206, obtaining Figure 4H the line segment 4105 shown. The length of the line segment 4105 is equal to the length between the cursor 1205 and the cursor 1206. In this way, without the user manually moving from the position where the cursor 1205 is located to the position where the cursor 1206 is located, the electronic device 100 can quickly draw the line segment 4105 between the cursor 1205 and the cursor 1206, saving the user's operation.

[0114] In other possible implementations, as Figure 4I shown, the electronic device 100 can receive a user operation by the user to draw a short line segment between the cursor 1205 and the cursor 1206, such as the user operation to draw the line segment 4106. The length of the line segment 4106 is less than the length between the cursor 1205 and the cursor 1206. In response to drawing the line segment 4106 between the cursor 1205 and the cursor 1206, the electronic device 100 can automatically draw a line segment between the cursor 1205 and the cursor 1206, obtaining Figure 4J the line segment 4105 shown. The length of the line segment 4105 is equal to the length between the cursor 1205 and the cursor 1206. In this way, without the user manually moving from the position where the cursor 1205 is located to the position where the cursor 1206 is located, the electronic device 100 can quickly draw the line segment 4105 between the cursor 1205 and the cursor 1206, saving the user's operation.

[0115] Not limited to the user operations of clicking and drawing short line segments, the electronic device 100 can also quickly draw a straight line between the cursor 1205 and the cursor 1206 based on other operations. This application does not make any limitations in this regard.

[0116] In some embodiments, the electronic device 100 can also receive a user operation to stop the function of automatically completing the line segment between the cursor 1205 and the cursor 1206, so that the user can draw a line segment of any length between the cursor 1205 and the cursor 1206.

[0117] Optionally, the electronic device 100 can receive a user operation to superimpose the cursor 1205 and the cursor 1206 and stop the function of automatically completing the line segment between the cursor 1205 and the cursor 1206.

[0118] Exemplarily, as Figure 4K shown, the electronic device 100 can receive an input operation for the cursor 1206, such as long-pressing the cursor 1206 and dragging the cursor 1206 to move towards the position where the cursor 1205 is located, so that the cursor 1206 and the cursor 1205 are superimposed and displayed.

[0119] Exemplarily, as Figure 4L shown, after the cursor 1206 and the cursor 1205 are superimposed and displayed, the electronic device 100 no longer displays the cursor 1206. The number "2" is displayed on the cursor 1205 to indicate that the cursor 1206 and the cursor 1205 are already superimposed and displayed.

[0120] Optionally, after the cursor 1206 and the cursor 1205 are superimposed and displayed, the electronic device 100 displays a prompt message 4107 near the cursor 1206. The prompt message 4107 includes the text "Disable positioning cursor", and the prompt message 4107 is used to prompt the user that the function of automatically completing the line segment between the cursor 1205 and the cursor 1206 has been stopped.

[0121] In some embodiments, the user can also drag the cursor 1206 again so that the cursor 1206 and the cursor 1205 are no longer superimposed and displayed. After the cursor 1206 and the cursor 1205 are no longer superimposed and displayed, the electronic device 100 can enable the function of automatically completing the line segment between the cursor 1205 and the cursor 1206 again. Specifically, reference can be made to Figures 4G - 4J the description in the embodiment, and details are not described herein again in this application.

[0122] Rotate the first scale 1202.

[0123] In some implementations, the electronic device 100 can receive a user operation to rotate the first scale 1202 to change the angle between the first scale 1202 and the horizontal line, so that the user can draw line segments, angles, and graphics of different angles through the first scale 1202.

[0124] Figures 5A - 5I Shows a schematic diagram of the electronic device 100 rotating the first scale 1202 based on a user operation.

[0125] Among them,Figures 5A - 5B FIG. Figures 5A - 5B shows a schematic diagram of an electronic device 100 rotating a first scale 1202 based on a user operation.

[0126] Exemplarily, as Figure 5A shown, the electronic device 100 may receive an operation of the user on the first scale 1202, such as an operation of long - pressing the first scale 1202 with two fingers and sliding the two fingers in the opposite direction. In response to the user operation, the electronic device 100 may rotate in the direction of the two - finger slide. Figure 5A In [the figure], the two fingers of the user rotate counter - clockwise, and the first scale 1202 also rotates counter - clockwise. As Figure 5B shown, the first scale 1202 may rotate to the Figure 5B angle shown. In response to the first scale 1202 rotating to the Figure 5B angle shown, the electronic device 100 may display the number "45" on the angle disc 1207, thereby prompting that the included angle between the first scale 1202 and the horizontal line is 45 degrees.

[0127] Figures 5C - 5F FIG. Figures 5C - 5F shows another schematic diagram of an electronic device 100 rotating a first scale 1202 based on a user operation.

[0128] Rotating the first scale 1202 by an angle A may be rotating the first scale 1202 by an angle A based on the 0 reference line. Optionally, the 0 reference line may be the horizontal line, and the 0 reference line may also be other reference lines, which are not limited in this application.

[0129] Exemplarily, as Figure 5C shown, the electronic device 100 may receive an input operation of the user on the angle disc 1207, such as a click. In response to the user input operation, the electronic device 100 may display the Figure 5D angle disc 5001 shown. Multiple angle values are displayed on the angle disc 5001, such as "0" - degree angle value, "45" - degree angle value, "90" - degree angle value, "135" - degree angle value, "180" - degree angle value, etc. An option 5109 is also displayed on the angle disc 5001. The user may long - press and drag the option 5109 to rotate the first scale 1202 to any angle.

[0130] Optionally, the included angle between the first scale 1202 and the horizontal line is 0 degrees, and the electronic device 100 may magnify and display the "0" - degree angle value to prompt that the current included angle between the first scale 1202 and the horizontal line is 0 degrees.

[0131] The user may choose to rotate the first scale 1202 to any angle.

[0132] Exemplarily, as Figure 5EAs shown, the electronic device 100 can long - press and drag the option 5109, so that the first scale 1202 can be rotated to any angle. When the electronic device 100 long - presses and drags the option 5109 counter - clockwise, the first scale 1202 can be rotated counter - clockwise. When the option 5109 is located at the scale line of the "45" - degree angle value, the electronic device 100 can thickly display the scale line of the "45" - degree angle value to prompt the current rotation angle of the first scale 1202.

[0133] Optionally, when the 0 reference line is horizontal, the electronic device 100 can rotate the first scale 1202 45 degrees counter - clockwise based on the horizontal line.

[0134] Optionally, Figure 5E In the first scale 1202 and the angle between the horizontal line is 45 degrees, the electronic device 100 can magnify the display of the "45" - degree angle value to prompt that the current angle between the first scale 1202 and the horizontal line is 45 degrees.

[0135] The user can confirm the rotation effect of the first scale 1202. When the user confirms that the first scale 1202 is rotated 45 degrees counter - clockwise, the user can release the finger, and the electronic device 100 can display Figure 5F the user interface shown.

[0136] In response to the first scale 1202 rotating to Figure 5F the angle shown, the electronic device 100 can display the number "45" on the angle disk 1207 to prompt that the angle between the first scale 1202 and the horizontal line is 45 degrees.

[0137] In some embodiments, when the user needs to continue rotating the first scale 1202, the electronic device 100 can receive the input operation of the user on the angle disk 1207, such as a click. In response to the user's input operation, the electronic device 100 can display Figure 5E the angle disk 5001 shown. Since the angle between the first scale 1202 and the horizontal line is 45 degrees, the option 5109 is still located at the scale line of the "45" - degree angle value.

[0138] Optionally, the angle between the first scale 1202 and the horizontal line is 45 degrees, and the electronic device 100 can magnify the display of the "45" - degree angle value to prompt that the current angle between the first scale 1202 and the horizontal line is 0 degrees.

[0139] The user can continue to drag option 5109 and rotate the first scale 1202 to other angles. For example, when the user drags option 5109 such that option 5109 is located at the scale line of the "90" - degree angle value, the electronic device 100 can rotate the first scale 1202 counter - clockwise by 90 degrees based on the 0 - degree reference line, that is, display the first scale 1202 perpendicular to the 0 - degree reference line (horizontal line).

[0140] Figures 5G - 5I Fig. shows another schematic diagram of the electronic device 100 rotating the first scale 1202 based on user operations.

[0141] Rotating the first scale 1202 by an angle A can be rotating the first scale 1202 by an angle A based on the 0 - reference line. Optionally, the 0 - reference line can be a horizontal line, and the 0 - reference line can also be other reference lines. This application does not limit this.

[0142] Reference Figure 5C According to the description in the embodiment, the electronic device 100 can receive a user's input operation on the angle disc 1207, such as a click. In response to the user's input operation, the electronic device 100 can display Figure 5G the shown angle disc 5002. Multiple angle values are displayed on the angle disc 5002, such as "0" - degree angle value, "45" - degree angle value, "90" - degree angle value, "135" - degree angle value, "180" - degree angle value, etc.

[0143] Optionally, the number "0" is displayed on the angle disc 5002 to indicate that the current included angle between the first scale 1202 and the horizontal line is 0 degrees.

[0144] The user can select any one of the multiple angle values, causing the first scale 1202 to rotate to the currently selected angle value by the user.

[0145] Exemplarily, as Figure 5G shown, the electronic device 100 can receive a user's input operation on the "45" - degree angle value among the multiple angle values, such as a click. In response to the user's input operation, the electronic device 100 can rotate the first scale 1202 counter - clockwise by 45 degrees and display Figure 5H the shown user interface.

[0146] Optionally, when the 0 - reference line is a horizontal line, the electronic device 100 can rotate the first scale 1202 counter - clockwise by 45 degrees based on the horizontal line.

[0147] In response to the first scale 1202 rotating to Figure 5HAt the shown angle, the electronic device 100 can display the number "45" on the angle disc 1207 to indicate that the included angle between the first scale 1202 and the horizontal line is 45 degrees.

[0148] In some embodiments, when the user needs to continue rotating the first scale 1202, as Figure 5H shown, the electronic device 100 can receive an input operation from the user on the angle disc 1207, such as a click. In response to the user's input operation, the electronic device 100 can display Figure 5I the shown angle disc 5002. The user can continue to rotate the first scale 1202 to other angles. For example, when the user clicks on the angle value of "90" degrees, the electronic device 100 can rotate the first scale 1202 counterclockwise by 90 degrees based on the 0-degree reference line, that is, display the first scale 1202 perpendicular to the 0-degree reference line (horizontal line). Again, for example, when the user clicks on the angle value of "45" degrees, the electronic device 100 can rotate the first scale 1202 counterclockwise by 45 degrees based on the 0-degree reference line. Since the included angle between the first scale 1202 and the 0-degree reference line is already 45 degrees, the position of the first scale 1202 remains unchanged and still shows Figure 5H the shown form.

[0149] Not limited to the above user operations for rotating the first scale 1202, the electronic device 100 can also rotate the first scale 1202 through other user operations, and this application does not limit this.

[0150] Quickly draw a specific angle based on the first scale 1202.

[0151] Figures 6A - 6I Shows a schematic diagram of the electronic device 100 quickly drawing a specific angle through the first scale 1202.

[0152] Exemplarily, as Figure 6A shown, the electronic device 100 can draw a line segment AB through the first scale 1202, and the line segment AB is parallel to the horizontal plane.

[0153] The user can rotate the first scale 1202. Exemplarily, as Figure 6A shown, the electronic device 100 can receive an input operation from the user on the angle disc 1207, such as a click. In response to the user's input operation, the electronic device 100 can display Figure 6B the shown angle disc 5002.

[0154] As Figure 6BAs shown, option 6001 is displayed below the angle disc 5002. Option 6001 includes the text "Set the current angle to 0 degrees", and option 6001 is used to prompt the user to set the 0-degree reference line. The electronic device 100 defaults the horizontal line as the 0-degree reference line, and the first scale 1202 rotates based on the 0-degree reference line. The user can set any line segment as the 0-degree reference line through option 6001.

[0155] When the user needs to rotate the first scale 1202 counterclockwise by 45 degrees, as Figure 6B shown, the electronic device 100 can receive the user's input operation for the "45" degree angle value among multiple angle values, such as a click. In response to the user's input operation, the electronic device 100 can rotate the first scale 1202 counterclockwise by 45 degrees and display Figure 6C the user interface shown. Figure 6C In [the figure] the included angle between the first scale 1202 and the 0-degree reference line is 45 degrees.

[0156] The user can move the first scale 1202 so that the first line 1203 of the first scale 1202 coincides with position A on the line segment AB. After that, the electronic device 100 can receive the user's drawing starting from position A along the first line 1203 to obtain Figure 6D the line segment AC shown. The included angle between the line segment AC and the line segment AB is 45 degrees.

[0157] Optionally, when the electronic device 100 monitors that the user drags the first scale 1202 towards position A on the line segment AB, the electronic device 100 can automatically adsorb the first scale 1202 so that the first line 1203 of the first scale 1202 coincides with position A on the line segment AB. Without the user manually making the first line 1203 of the first scale 1202 coincide with position A on the line segment AB, it can also improve the accuracy of the coincidence of the first line 1203 of the first scale 1202 with position A on the line segment AB.

[0158] In some embodiments, when the user needs to continue drawing other angle values based on the line segment AC, the electronic device 100 can set the line segment AC as the 0-degree reference line, so that the first scale 1202 can rotate other angle values based on the line segment AC. Without the user having to calculate how many angle values need to be rotated based on the horizontal line to obtain other angle values, it saves the user's calculation amount and enables more rapid drawing of any angle.

[0159] As Figure 6E shown, the electronic device 100 can receive the user's input operation for option 6001 (such as a click). In response to the user's input operation, the electronic device 100 can display Figure 6F the user interface shown.

[0160] As shown Figure 6F in Figure 6F , in response to a user's input operation on option 6001, the electronic device 100 may change the display form of option 6001. For example, the text "Reset to 0 degrees" is displayed on option 6001 to prompt the user that the current setting is that line segment AC is the 0-degree reference line.

[0161] Optionally, the user may also click on option 6001 again, causing the electronic device 100 to once again use the horizontal line as the 0-degree reference line.

[0162] After the electronic device 100 uses line segment AC as the 0-degree reference line, as Figure 6F shown in Figure 6F , the electronic device 100 may receive a user's input operation on the "45" degree angle value in the angle disc 5002, such as a click. In response to the user's input operation, the electronic device 100 may rotate the first scale 1202 counterclockwise by 45 degrees and display Figure 6G the user interface shown in Figure 6G .

[0163] As Figure 6G shown in Figure 6G , the first scale 1202 is rotated counterclockwise by 45 degrees based on line segment AC. In response to the 45-degree counterclockwise rotation based on line segment AC, the electronic device 100 may display the number "45" on the angle disc 1207, thereby prompting that the angle between the first scale 1202 and the 0-degree reference line (line segment AC) is 45 degrees.

[0164] As Figure 6G and Figure 6H shown in Figure 6G and Figure 6H , the user may move the first scale 1202 so that the first line 1203 of the first scale 1202 coincides with position A on line segment AB. After that, the electronic device 100 may receive a line segment AD drawn by the user starting from position A along the first line 1203, as Figure 6I shown in Figure 6I . The angle between line segment AD and line segment AC is 45 degrees.

[0165] Optionally, when the electronic device 100 detects that the user drags the first scale 1202 towards position A on line segment AB, the electronic device 100 may automatically snap the first scale 1202 so that the first line 1203 of the first scale 1202 coincides with position A on line segment AB. Without the user manually making the first line 1203 of the first scale 1202 coincide with position A on line segment AB, the accuracy of the coincidence of the first line 1203 of the first scale 1202 with position A on line segment AB can also be improved.

[0166] Figure 7 FIG. Figure 7 is a schematic flowchart of a method for using a ruler and compass tool provided by the present application.

[0167] S701. The electronic device displays a first user interface of a first application, and a scale icon is displayed on the first user interface.

[0168] Exemplarily, the first user interface can be Figure 1C the user interface 1200 shown, and the scale icon can be Figure 1C the scale icon option 1201 shown.

[0169] S702. The electronic device receives a first operation of the user on the scale icon, and displays a first scale on the first user interface. The first scale includes a first cursor and a second cursor.

[0170] Exemplarily, the first operation can be Figure 1C the input operation on the scale icon option 1201 in the user interface 1200 shown.

[0171] The first scale can be Figure 1D the first scale 1202 shown.

[0172] The first cursor can be Figure 1D the cursor 1205 shown, and the second cursor can be Figure 1D the cursor 1206 shown.

[0173] S703. The electronic device receives a second operation on the first scale.

[0174] In a possible implementation, the second operation includes any one of the following: an operation of drawing a second line segment between the first cursor and the second cursor, the length of the second line segment being less than the length of the first line segment, or a click operation between the first cursor and the second cursor.

[0175] In this way, the user can obtain the line segment between the first cursor and the second cursor without sliding along the first scale from the first cursor to the second cursor, saving the user's operation.

[0176] Exemplarily, the second operation can be Figure 4G the input operation acting between the cursor 1205 and the cursor 1206 shown, such as a click operation.

[0177] Exemplarily, the second operation can be Figure 4I the user operation of drawing a short straight line acting between the cursor 1205 and the cursor 1206 shown, such as the user operation of drawing the line segment 4106.

[0178] S704. In response to the second operation, the electronic device determines whether the second operation is a user operation acting between the first cursor and the second cursor.

[0179] S705. When it is determined that the second operation is a user operation acting between the first cursor and the second cursor, the electronic device displays a first line segment on the first user interface, and the length of the first line segment is equal to the distance length between the first cursor and the second cursor.

[0180] Exemplarily, the first line segment can be Figure 4H or Figure 4J the line segment 4105 shown.

[0181] Optionally, scales and scale values are displayed on the first scale.

[0182] Optionally, between the first cursor and the second cursor, it can refer to the connecting line where the first cursor points to the second cursor.

[0183] Optionally, the second operation is a user operation acting between the first cursor and the second cursor, which can mean that the starting position of the second operation is on the connecting line between the first cursor and the second cursor, and the ending position of the second operation is also on the connecting line between the first cursor and the second cursor. Or, all or most of the trajectory of the second operation is located on the connecting line between the first cursor and the second cursor.

[0184] Through this method, the electronic device can automatically complete the line segment between the first cursor and the second cursor based on the user operation acting between the first cursor and the second cursor through the first scale on the first scale, achieving the quick drawing of a line segment with a specific length, and the specific length is equal to the distance length between the first cursor and the second cursor, saving the user operation.

[0185] In a possible implementation, the second operation is a sliding operation along the first scale; the method further includes: when it is determined that the second operation is not a user operation acting between the first cursor and the second cursor, the electronic device displays a second line segment on the first user interface, and the length of the second line segment is equal to the length of the sliding trajectory of the second operation.

[0186] Optionally, the second operation is not a user operation acting between the first cursor and the second cursor, which can mean that the starting position of the second operation is not on the connecting line between the first cursor and the second cursor, or the ending position of the second operation is not on the connecting line between the first cursor and the second cursor, or all or most of the trajectory of the second operation is not on the connecting line between the first cursor and the second cursor.

[0187] In a possible implementation, the first scale includes a first line and a second line, the first line is used to draw a straight line on the first user interface, and the second line is used to draw a curve on the first user interface.

[0188] In this way, the user can not only draw a straight line through the first scale, but also draw a curve through the first scale.

[0189] Exemplarily, the first line may be Figure 1D the first line 1203 shown, and the second line may be Figure 1D the second line 1204 shown.

[0190] In a possible implementation, the second operation is a sliding operation along the first line on the first scale.

[0191] In a possible implementation, a first number is displayed above the second cursor, and the first number is used to indicate the distance length between the first cursor and the second cursor. In this way, the user can view the distance length between the first cursor and the second cursor in real time.

[0192] Exemplarily, the first number may be Figure 4E the number 4103 shown, or Figure 4F the number 4104 shown.

[0193] In a possible implementation, the method further includes: the electronic device receives a third operation of the user on the second cursor; in response to the third operation, the electronic device overlaps and displays the first cursor and the second cursor.

[0194] In this way, the user can overlap and display the first cursor and the second cursor, and the electronic device stops the function of automatically completing the line segment between the first cursor and the second cursor, so that the user can draw a line segment of any length along the first scale.

[0195] Exemplarily, the third operation may be Figure 4K a user operation of long-pressing the cursor 1206 and dragging the cursor 1206 to move along the first scale towards the position where the cursor 1205 is located as shown.

[0196] The overlapping display of the first cursor and the second cursor may be Figure 4L the overlapping display of the cursor 1206 and the cursor 1205 as shown.

[0197] In a possible implementation, after the electronic device overlaps and displays the first cursor and the second cursor, the method further includes: the electronic device displays a first prompt message above the first cursor, and the first prompt message is used to indicate that the automatic completion of the line segment between the first cursor and the second cursor has stopped.

[0198] Exemplarily, the first prompt message may be Figure 4L the prompt message 4107 shown.

[0199] In a possible implementation, the first scale includes a first angle disc, and a second number is displayed on the first angle disc, and the second number is used to indicate the included angle between the first scale and the first reference line.

[0200] In a possible implementation, the first reference line is parallel to the horizontal line. Optionally, not limited to the first reference line being parallel to the horizontal line, the first reference line can also be other reference lines, and this application does not make any limitations in this regard.

[0201] In this way, the user can view the angle between the first scale and the first reference line through the second number to determine the orientation of the first scale.

[0202] Exemplarily, the first angle disc can be Figure 1D the angle disc 1207 as shown.

[0203] Exemplarily, the second number can be Figure 1D the number "0" as shown.

[0204] Exemplarily, the first reference line can be Figure 6C the line segment AB as shown.

[0205] In a possible implementation, the method further includes: the electronic device receives a fourth operation from the user on the first angle disc; in response to the fourth operation, the electronic device displays a second angle disc, which includes a plurality of angle values; the electronic device receives a fifth operation from the user on a first angle value among the plurality of angle values; in response to the fifth operation, the electronic device rotates the first scale along a first direction by the first angle value on the basis of the first reference line.

[0206] In this way, the user can rotate the first scale to change the orientation of the first scale.

[0207] Exemplarily, the fourth operation can be Figure 5C the click operation on the angle disc 1207 as shown. The second angle disc can be Figure 5D the angle disc 5001 as shown. The plurality of angle values can be "0" degree angle value, "45" degree angle value, "90" degree angle value, "135" degree angle value, "180" degree angle value, etc. The first angle value can be the "45" degree angle value, and the fifth operation can be the user operation of long-pressing and dragging the option 5109 counterclockwise so that the option 5109 is located on the scale line of the "45" degree angle value. The first direction can be the counterclockwise direction.

[0208] Exemplarily, the sixth operation can be Figure 5C the click operation on the angle disc 1207 as shown. The second angle disc can be Figure 5G the angle disc 5002 as shown. The plurality of angle values can be "0" degree angle value, "45" degree angle value, "90" degree angle value, "135" degree angle value, "180" degree angle value, etc. The first angle value can be the "45" degree angle value, and the seventh operation can be the user operation of clicking on the "45" degree angle value. The first direction can be the counterclockwise direction.

[0209] In a possible implementation, after the electronic device rotates the first scale along a first direction by a first angular value based on a first reference line, the method further includes: the electronic device receiving a user operation to move the first scale to the starting point of a first line segment; the electronic device receiving a user operation to draw along the first scale from the starting point of the first line segment and display a third line segment on a first user interface, wherein the included angle between the third line segment and the first reference line is the first angular value.

[0210] In this way, the user can rotate the first scale to change the orientation of the first scale and draw a specific angle.

[0211] In a possible implementation, the method further includes: the electronic device receiving a sixth operation by the user on a first angle disc; in response to the sixth operation, the electronic device displaying a second angle disc, which includes a plurality of angular values and a first option; the electronic device receiving a seventh operation by the user on the first option; in response to the seventh operation, the electronic device setting the first line segment as a second reference line; the electronic device receiving an eighth operation by the user on a second angular value among the plurality of angular values; in response to the eighth operation, the electronic device rotating the first scale along a second direction by a second angular value based on the second reference line.

[0212] Exemplarily, the first line segment may be Figure 6D the line segment AC shown in the figure. The line segment AC may be the second reference line, and the sixth operation may be Figure 6A the click operation on the angle disc 1207 shown in the figure. The second angle disc may be Figure 6B the angle disc 5002 shown in the figure. The plurality of angular values may be angular values such as "0" degrees, "45" degrees, "90" degrees, "135" degrees, "180" degrees, etc. The first option may be Figure 6B the option 6001 shown in the figure. The seventh operation may be Figure 6F the input operation on the option 6001 shown in the figure. The second angular value may be the angular value of "45" degrees, and the eighth operation may be Figure 6F the input operation on the angular value of "45" degrees in the angle disc 5002 shown in the figure, such as a click. The second direction may be the counterclockwise direction.

[0213] In a possible implementation, after the electronic device rotates the first scale along a second direction by a second angular value based on the second reference line, the method further includes: the electronic device receiving a user operation to move the first scale to the starting point of a first line segment; the electronic device receiving a user operation to draw along the first scale from the starting point of the first line segment and display a fourth line segment on a first user interface, wherein the included angle between the fourth line segment and the second reference line is the second angular value.

[0214] The rotation of the first scale of the electronic device is obtained by rotating on the basis of a reference line. Generally, the reference line is fixed. For example, the default reference line can be parallel to the horizontal line. By this method, the electronic device can use any line segment as the reference line based on user operations, that is, change the reference line, and rotate a certain angle on the basis of the new reference line to achieve convenient drawing of any angle by the electronic device.

[0215] In a possible implementation, when the second number is 0, the second reference line is the same as the first reference line; when the second number is not 0, the second reference line is different from the first reference line.

[0216] Exemplarily, the fourth line segment can be Figure 6I the line segment AD shown.

[0217] In a possible implementation, the method further includes: the electronic device receives a ninth operation from the user to reduce the first user interface by a first ratio; in response to the ninth operation, the electronic device also reduces the first scale by the first ratio; or, the electronic device receives a tenth operation from the user to enlarge the first user interface by a second ratio; in response to the tenth operation, the electronic device also enlarges the first scale by the second ratio.

[0218] In this way, the user can scale the first user interface, and the size of the corresponding first scale will also be scaled accordingly. Since there are scales displayed on the first scale, the scales displayed on the first scale will also be scaled correspondingly, ensuring that the length of the line segment displayed on the first user interface remains unchanged before and after scaling.

[0219] Exemplarily, the ninth operation can be Figure 3A the user operation of pinching two fingers towards each other on the user interface 1200 shown, and the first ratio can be 0.8 times.

[0220] Exemplarily, the tenth operation can be Figure 3C the user operation of sliding two fingers away from each other on the user interface 1200 shown, and the second ratio can be 1.3 times.

[0221] Referring to Figure 8 , Figure 8 shows a schematic hardware structure diagram of the electronic device 100.

[0222] The electronic device 100 may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, a vehicle-mounted device, a smart home device, and / or a smart city device. The embodiments of the present application do not impose special restrictions on the specific type of the electronic device.

[0223] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0224] It can be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than those illustrated, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0225] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0226] The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.

[0227] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory may save the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can directly call it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0228] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0229] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be respectively coupled to the touch sensor 180K, the charger, the flashlight, the camera 193, etc. through different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface, thereby implementing the touch function of the electronic device 100.

[0230] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple groups of I2S buses. The processor 110 may be coupled to the audio module 170 through the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit audio signals to the wireless communication module 160 through the I2S interface to implement the function of answering a phone call through a Bluetooth headset.

[0231] The PCM interface can also be used for audio communication to sample, quantize, and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through the PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface to implement the function of answering a phone call through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0232] The UART interface is a general-purpose serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 may transmit audio signals to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0233] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate through the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100.

[0234] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0235] The USB interface 130 is an interface that conforms to the USB standard specification, and can specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect a headset to play audio through the headset. This interface can also be used to connect other electronic devices, such as AR devices, etc.

[0236] It can be understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are only illustrative descriptions and do not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0237] The charging management module 140 is used to receive a charging input from a charger. Among them, the charger can be a wireless charger or a wired charger. In some embodiments of wired charging, the charging management module 140 can receive the charging input from the wired charger through the USB interface 130. In some embodiments of wireless charging, the charging management module 140 can receive the wireless charging input through the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device through the power management module 141.

[0238] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives inputs from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, the wireless communication module 160, etc. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be disposed in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 can also be disposed in the same device.

[0239] The wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, and the baseband processor, etc.

[0240] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, the antenna 1 can be multiplexed as the diversity antenna of the wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0241] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc. applied to the electronic device 100. The mobile communication module 150 can include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves by the antenna 1, filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor and convert it into electromagnetic waves through the antenna 1 for radiation. In some embodiments, at least some functional modules of the mobile communication module 150 can be disposed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 can be disposed in the same device.

[0242] The modulation and demodulation processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Subsequently, the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays an image or video through the display screen 194. In some embodiments, the modulation and demodulation processor may be an independent device. In other embodiments, the modulation and demodulation processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.

[0243] The wireless communication module 160 may provide solutions for wireless communications applied to the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signal, and transmits the processed signal to the processor 110. The wireless communication module 160 may also receive the signal to be transmitted from the processor 110, perform frequency modulation and amplification on it, and convert it into electromagnetic waves through the antenna 2 and radiate it out.

[0244] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, such that electronic device 100 can communicate with a network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS), and / or satellite based augmentation systems (SBAS).

[0245] Electronic device 100 implements a display function through a GPU, display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, and is connected to display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.

[0246] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.

[0247] The electronic device 100 can implement the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor, etc.

[0248] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light passes through the lens and is transmitted to the camera photosensitive element. The optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also optimize the noise and brightness of the image through algorithms. The ISP can also optimize parameters such as the exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0249] The camera 193 is used to capture static images or videos. An object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in standard RGB, YUV, etc. formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0250] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.

[0251] The video codec is used to compress or decompress digital videos. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple coding formats, such as: Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0252] The NPU is a neural-network (NN) computing processor. By learning from the biological neural network structure, such as learning from the transmission pattern between human brain neurons, it can quickly process the input information and can also continuously self-learn. Through the NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as: image recognition, face recognition, speech recognition, text understanding, etc.

[0253] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).

[0254] The random access memory may include static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation of DDR SDRAM is generally called DDR5 SDRAM), etc.; the non-volatile memory may include disk storage devices, flash memory.

[0255] Flash memory can be classified into NOR Flash, NAND Flash, 3D NAND Flash, etc. according to the operating principle, and can be classified into single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the number of potential levels of storage cells. According to the storage specification, it can be classified into universal flash storage (UFS), embedded multi media Card (eMMC), etc.

[0256] The random access memory can be directly read and written by the processor 110, and can be used to store the operating system or executable programs (such as machine instructions) of other running programs, and can also be used to store data of users and application programs, etc.

[0257] The non-volatile memory can also store executable programs and data of users and application programs, etc., and can be pre-loaded into the random access memory for direct reading and writing by the processor 110.

[0258] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, files such as music and videos are saved in the external non-volatile memory.

[0259] The electronic device 100 can implement audio functions through the audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and the application processor, etc. For example, music playback, recording, etc.

[0260] The audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or some functional modules of the audio module 170 can be disposed in the processor 110.

[0261] The speaker 170A, also known as the "loudspeaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or hands-free calls through the speaker 170A.

[0262] The receiver 170B, also known as the "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a call or a voice message, the voice can be received by bringing the receiver 170B close to the human ear.

[0263] The microphone 170C, also known as the "microphone" or "transmitter", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can input the sound signal into the microphone 170C by speaking close to the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In some other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also implement a noise reduction function. In some other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and implement functions such as directional recording.

[0264] The headphone jack 170D is used to connect a wired headphone. The headphone jack 170D can be a USB interface 130, or a 3.5 mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0265] The pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can include at least two parallel plates with conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, the instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.

[0266] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., the x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. Exemplarily, when the shutter is pressed, the gyroscope sensor 180B detects the angle of jitter of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and makes the lens offset the jitter of the electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenarios.

[0267] The barometric pressure sensor 180C is used to measure barometric pressure. In some embodiments, the electronic device 100 calculates the altitude according to the barometric pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.

[0268] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip according to the magnetic sensor 180D. Furthermore, according to the detected opening and closing state of the leather case or the flip, features such as automatic unlocking of the flip can be set.

[0269] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0270] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance through infrared or laser. In some embodiments, in the shooting scene, the electronic device 100 can use the distance sensor 180F to measure distance to achieve fast focusing.

[0271] The proximity light sensor 180G can include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The light-emitting diode can be an infrared light-emitting diode. The electronic device 100 emits infrared light outward through the light-emitting diode. The electronic device 100 uses the photodiode to detect the infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear for a call, so as to automatically turn off the screen to achieve the purpose of power saving. The proximity light sensor 180G can also be used for automatic unlocking and locking of the leather case mode and pocket mode.

[0272] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance during photography. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touch.

[0273] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access application locks, fingerprint photography, fingerprint answering of incoming calls, etc.

[0274] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of the processor near the temperature sensor 180J in order to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is below another threshold, the electronic device 100 heats the battery 142 to prevent abnormal shutdown of the electronic device 100 caused by low temperature. In some other embodiments, when the temperature is below yet another threshold, the electronic device 100 boosts the output voltage of the battery 142 to prevent abnormal shutdown caused by low temperature.

[0275] The touch sensor 180K, also known as the "touch control device". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also known as a "touch control screen". The touch sensor 180K is used to detect touch operations acting thereon or nearby. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a different position from the display screen 194.

[0276] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire the vibration signals of the vibrating bone mass of the human vocal part. The bone conduction sensor 180M can also contact the human pulse and receive blood pressure pulsation signals. In some embodiments, the bone conduction sensor 180M can also be disposed in the earphone to form a bone conduction earphone. The audio module 170 can parse out the voice signal based on the vibration signals of the vibrating bone mass of the human vocal part acquired by the bone conduction sensor 180M to implement the voice function. The application processor can parse out the heart rate information based on the blood pressure pulsation signals acquired by the bone conduction sensor 180M to implement the heart rate detection function.

[0277] The button 190 includes a power-on button, volume buttons, etc. The button 190 can be a mechanical button or a touch button. The electronic device 100 can receive button inputs and generate key signal inputs related to the user settings and function controls of the electronic device 100.

[0278] The motor 191 can generate vibration prompts. The motor 191 can be used for incoming call vibration prompts and also for touch vibration feedback. For example, touch operations for different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations on different areas of the display screen 194, the motor 191 can also correspond to different vibration feedback effects. Different application scenarios (such as time reminder, receiving messages, alarm clock, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0279] The indicator 192 can be an indicator light and can be used to indicate the charging state, power change, and can also be used to indicate messages, missed calls, notifications, etc.

[0280] The SIM card interface 195 is used to connect the SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation from the electronic device 100. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to achieve functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, that is, an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0281] The software system of the electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservices architecture, or cloud architecture. In the embodiments of the present invention, the Android system with a layered architecture is taken as an example to exemplarily illustrate the software structure of the electronic device 100.

[0282] Figure 9 It is a software structure block diagram of the electronic device 100 in the embodiments of the present invention.

[0283] The layered architecture divides software into several layers, and each layer has clear roles and divisions of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0284] The application layer may include a series of application packages.

[0285] As Figure 9 shown, the application packages may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.

[0286] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions.

[0287] As Figure 9 shown, the application framework layer may include a window manager, a content provider, a view system, a telephone manager, a resource manager, a notification manager, etc.

[0288] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0289] The content provider is used to store and obtain data, and make this data accessible to applications. The data may include videos, images, audio, dialed and answered calls, browsing history and bookmarks, phone books, etc.

[0290] The view system includes visible controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a short message notification icon may include a view for displaying text and a view for displaying pictures.

[0291] The telephone manager is used to provide the communication function of the electronic device 100. For example, the management of call status (including connection, disconnection, etc.).

[0292] The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, and so on.

[0293] The notification manager enables an application to display notification information in the status bar. It can be used to convey messages of the notification type, and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to inform that a download is completed, a message reminder, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or a scrolling text, such as a notification of a background-running application, or a notification that appears on the screen in the form of a dialogue window. For example, it prompts text information in the status bar, emits a prompt tone, the electronic device vibrates, the indicator light flashes, etc.

[0294] Android Runtime includes the core libraries and the virtual machine. Android runtime is responsible for the scheduling and management of the Android system.

[0295] The core libraries contain two parts: one part is the functional functions that the Java language needs to call, and the other part is the core libraries of Android.

[0296] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as the management of the object life cycle, stack management, thread management, security and exception management, and garbage collection.

[0297] The system libraries can include multiple functional modules. For example: surface manager, Media Libraries, 3D graphics processing library (such as: OpenGL ES), 2D graphics engine (such as: SGL), etc.

[0298] The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.

[0299] The media libraries support the playback and recording of a variety of common audio and video formats, as well as static image files, etc. The media libraries can support a variety of audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0300] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.

[0301] The 2D graphics engine is the drawing engine for 2D drawing.

[0302] The kernel layer is the layer between the hardware and the software. The kernel layer contains at least a display driver, a camera driver, an audio driver, and a sensor driver.

[0303] Next, in combination with the capture and photographing scenario, the working processes of the software and hardware of the electronic device 100 are exemplarily described.

[0304] When the touch sensor 180K receives a touch operation, a corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including information such as touch coordinates and the timestamp of the touch operation). The raw input event is stored in the kernel layer. The application framework layer obtains the raw input event from the kernel layer and identifies the control corresponding to the input event. Taking the touch operation as a touch click operation and the control corresponding to the click operation being the control of the camera application icon as an example, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer, and captures a static image or video through the camera 193.

[0305] The various embodiments of the present application can be combined arbitrarily to achieve different technical effects.

[0306] In the above embodiments, they can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from a website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that the computer can access or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid-state disk (SSD)), etc.

[0307] Those of ordinary skill in the art can understand all or part of the processes in the above method embodiments. These processes can be completed by instructing relevant hardware with a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments. The aforementioned storage medium includes: ROM or random access memory RAM, magnetic disk, or optical disk, etc., which can store program codes of various types.

[0308] In summary, the above are only examples of the technical solutions of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made based on the disclosure of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method of using a ruler and compass tool, characterized in that, The method includes: The electronic device displays a first user interface of a first application, and a ruler icon is displayed on the first user interface; The electronic device receives a first operation of the user on the ruler icon, and displays a first ruler on the first user interface, and the first ruler includes a first cursor and a second cursor; The electronic device receives a second operation on the first ruler; In response to the second operation, the electronic device determines whether the second operation is a user operation acting between the first cursor and the second cursor; When it is determined that the second operation is a user operation acting between the first cursor and the second cursor, the electronic device displays the first line segment on the first user interface, and the length of the first line segment is equal to the distance length between the first cursor and the second cursor.

2. The method according to claim 1, wherein The second operation is a sliding operation along the first ruler; the method further includes: When it is determined that the second operation is not a user operation acting between the first cursor and the second cursor, the electronic device displays a second line segment on the first user interface, and the length of the second line segment is equal to the length of the sliding trajectory of the second operation.

3. The method according to claim 1 or 2, characterized in that, The second operation includes any one of the following: an operation of drawing a second line segment between the first cursor and the second cursor along the first ruler, the length of the second line segment being less than the length of the first line segment, or a click operation between the first cursor and the second cursor.

4. The method according to any one of claims 1 to 3, characterized in that The first ruler includes a first line and a second line, the first line is used to draw a straight line on the first user interface, and the second line is used to draw a curve on the first user interface.

5. The method according to claim 4, characterized in that The second operation is a sliding operation along the first line on the first ruler.

6. The method according to any one of claims 1-5, characterized in that, A first number is displayed above the second cursor, and the first number is used to indicate the distance length between the first cursor and the second cursor.

7. The method according to any one of claims 1 to 6, characterized in that, The method further includes: The electronic device receives a third operation of the user on the second cursor; In response to the third operation, the electronic device overlaps and displays the first cursor and the second cursor.

8. The method according to claim 7, wherein After the electronic device overlaps and displays the first cursor and the second cursor, the method further includes: The electronic device displays a first prompt message above the first cursor, and the first prompt message is used to indicate that the automatic completion of the line segment between the first cursor and the second cursor has stopped.

9. The method according to any one of claims 1-8, characterized in that, A first angle disc is included on the first ruler, and a second number is displayed on the first angle disc, and the second number is used to indicate the included angle between the first ruler and a first reference line.

10. The method according to claim 9, wherein The first reference line is parallel to the horizontal line.

11. The method according to claim 9 or 10, characterized in that, The method further includes: The electronic device receives a fourth operation of the user on the first angle disc; In response to the fourth operation, the electronic device displays a second angle disc, and the second angle disc includes a plurality of angle values; The electronic device receives a fifth operation of the user on a first angle value among the plurality of angle values; In response to the fifth operation, the electronic device rotates the first scale along a first direction by the first angular value on the basis of the first reference line.

12. The method according to claim 11, wherein After the electronic device rotates the first scale along the first direction by the first angular value on the basis of the first reference line, the method further includes: The electronic device receives a user operation to move the first scale to the starting point of the first line segment; The electronic device receives a user operation to draw along the first scale from the starting point of the first line segment and display a third line segment on the first user interface, wherein the included angle between the third line segment and the first reference line is the first angular value.

13. The method according to any one of claims 9-12, characterized in that, The method further includes: The electronic device receives a sixth operation of the user on the first angle disc; In response to the sixth operation, the electronic device displays a second angle disc, which includes a plurality of angular values and a first option; The electronic device receives a seventh operation of the user on the first option; In response to the seventh operation, the electronic device sets the first line segment as the second reference line; The electronic device receives an eighth operation of the user on a second angular value among the plurality of angular values; In response to the eighth operation, the electronic device rotates the first scale along a second direction by the second angular value on the basis of the second reference line.

14. The method according to claim 13, wherein After the electronic device rotates the first scale along the second direction by the second angular value on the basis of the second reference line, the method further includes: The electronic device receives a user operation to move the first scale to the starting point of the first line segment; The electronic device receives a user operation to draw along the first scale from the starting point of the first line segment and display a fourth line segment on the first user interface, wherein the included angle between the fourth line segment and the second reference line is the second angular value.

15. The method according to claim 13 or 14, characterized in that When the second number is 0, the second reference line is the same as the first reference line; when the second number is not 0, the second reference line is different from the first reference line.

16. The method according to any one of claims 1-15, characterized in that, The method further includes: The electronic device receives a ninth operation of the user to reduce the first user interface by a first ratio; In response to the ninth operation, the electronic device reduces the first scale by the first ratio as well; Or, The electronic device receives a tenth operation of the user to enlarge the first user interface by a second ratio; In response to the tenth operation, the electronic device enlarges the first scale by the second ratio as well.

17. An electronic device, characterized in that, Comprising one or more processors and one or more memories; wherein, the one or more memories are coupled to the one or more processors, the one or more memories are used to store computer program code, the computer program code includes computer instructions, when the one or more processors execute the computer instructions, the method according to any one of claims 1-16 is performed.

18. A computer-readable storage medium, comprising instructions, characterized in that, When the instructions run on an electronic device, the method according to any one of claims 1-16 is performed.