CN111563214B - Reference line processing method and device - Google Patents

Reference line processing method and device Download PDF

Info

Publication number
CN111563214B
CN111563214B CN202010357127.4A CN202010357127A CN111563214B CN 111563214 B CN111563214 B CN 111563214B CN 202010357127 A CN202010357127 A CN 202010357127A CN 111563214 B CN111563214 B CN 111563214B
Authority
CN
China
Prior art keywords
point
reference line
distance
determining
webpage element
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010357127.4A
Other languages
Chinese (zh)
Other versions
CN111563214A (en
Inventor
张博
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010357127.4A priority Critical patent/CN111563214B/en
Publication of CN111563214A publication Critical patent/CN111563214A/en
Application granted granted Critical
Publication of CN111563214B publication Critical patent/CN111563214B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Between Computers (AREA)
  • Document Processing Apparatus (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The present disclosure discloses a reference line processing method, apparatus, electronic device, and computer-readable storage medium. The method comprises the following steps: acquiring at least one second webpage element positioned in the current editing page as a reference webpage element according to the position change of the first webpage element in the current editing page in the webpage editor; generating a first external rectangle according to the first webpage element, and generating a second external rectangle according to the reference webpage element; determining a first point according to the first circumscribed rectangle, and determining a second point according to the reference webpage element; and determining a reference line according to the first point and the second point, wherein the reference line is a line segment. According to the embodiment of the disclosure, the reference line is determined to be the line segment through the points in the circumscribed rectangle, so that confusion of the corresponding reference line when the page elements in the edited page are more can be avoided, and the relation between the circumscribed rectangle and the circumscribed rectangle is not required to be considered.

Description

Reference line processing method and device
Technical Field
The present disclosure relates to the technical field of browsers, and in particular, to a reference line processing method, a reference line processing device and a computer readable storage medium.
Background
The web page is a basic element constituting a website and is a platform for bearing various website applications. In particular, the web page is a plain text file containing hypertext markup language (Hyper Text Markup Language, HTML) tags. The text and the picture are two most basic elements forming a webpage, and in addition, the elements of the webpage also comprise audio, video, animation and programs.
In the prior art, a web page is often edited and produced by an HTML editor, for example, the various elements described above are added to the web page using the HTML editor. While adding elements through an HTML editor, reference lines are typically required to assist in the positioning or alignment of the elements.
However, in the prior art, the reference line drawn by the HTML editor is usually a straight line without a boundary, and when the page elements are more, the corresponding reference lines are more, which causes confusion in editing the page.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
The technical problem solved by the present disclosure is to provide a reference line processing method, so as to at least partially solve the technical problem in the prior art that when there are more page elements, there are more corresponding reference lines, and the edited page is confused. Further, a reference line processing apparatus, a reference line processing hardware apparatus, a computer-readable storage medium, and a reference line processing terminal are provided.
In order to achieve the above object, according to one aspect of the present disclosure, there is provided the following technical solutions:
a reference line processing method, comprising:
acquiring at least one second webpage element positioned in a current editing page as a reference webpage element according to the position change of a first webpage element in the current editing page in a webpage editor;
generating a first external rectangle according to the first webpage element, and generating a second external rectangle according to the reference webpage element;
determining a first point according to the first circumscribed rectangle, and determining a second point according to the second circumscribed rectangle;
determining a reference line from the first point and the second point; wherein the reference line is a line segment.
In order to achieve the above object, according to one aspect of the present disclosure, there is provided the following technical solutions:
a reference line processing apparatus comprising:
the webpage element acquisition module is used for acquiring at least one second webpage element positioned in the current editing page as a reference webpage element according to the position change of the first webpage element in the current editing page in the webpage editor;
the external rectangle generation module is used for generating a first external rectangle according to the first webpage element and generating a second external rectangle according to the reference webpage element;
the point determining module is used for determining a first point according to the first circumscribed rectangle and determining a second point according to the second circumscribed rectangle;
a reference line determining module for determining a reference line according to the first point and the second point; wherein the reference line is a line segment.
In order to achieve the above object, according to one aspect of the present disclosure, there is provided the following technical solutions:
an electronic device, comprising:
a memory for storing non-transitory computer readable instructions; and
a processor for executing the computer readable instructions such that the processor, when executed, implements the reference line processing method of any of the above.
In order to achieve the above object, according to one aspect of the present disclosure, there is provided the following technical solutions:
a computer readable storage medium storing non-transitory computer readable instructions which, when executed by a computer, cause the computer to perform the reference line processing method of any one of the preceding claims.
In order to achieve the above object, according to still another aspect of the present disclosure, there is further provided the following technical solutions:
a reference line processing terminal comprises any one of the reference line processing devices.
According to the embodiment of the disclosure, at least one second webpage element in a current editing page is obtained as a reference webpage element according to the position change of the first webpage element in the current editing page in the webpage editor, a first external rectangle is generated according to the first webpage element, a second external rectangle is generated according to the reference webpage element, a first point is determined according to the first external rectangle, a second point is determined according to the second external rectangle, a reference line is determined according to the first point and the second point, the reference line is a line segment, and thus the reference line is determined as a line segment through the points in the external rectangle, not only can the disorder of the corresponding reference line when the page elements in the editing page are more be avoided, but also the relation between the external rectangle and the external rectangle is not required to be considered.
The foregoing description is only an overview of the disclosed technology, and may be implemented in accordance with the disclosure of the present disclosure, so that the above-mentioned and other objects, features and advantages of the present disclosure can be more clearly understood, and the following detailed description of the preferred embodiments is given with reference to the accompanying drawings.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1 is a flow diagram of a reference line processing method according to one embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a reference line processing apparatus according to one embodiment of the present disclosure;
fig. 3 is a schematic structural view of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
Example 1
In order to solve the technical problem that the edited pages are disordered due to the fact that corresponding reference lines are more when page elements are more in the prior art, the embodiment of the disclosure provides a reference line processing method. As shown in fig. 1, the reference line processing method mainly includes the following steps S11 to S14.
Step S11: and acquiring at least one second webpage element positioned in the current editing page as a reference webpage element according to the position change of the first webpage element in the current editing page in the webpage editor.
In order to distinguish between different web page elements, the web page element whose position is changed is defined herein as a first web page element, and the reference web page element of the first web page element is defined as a second web page element. The first webpage element and the second webpage element can be words, pictures, audio, video, animation, programs and the like. The shape thereof may be circular, rectangular, polygonal, etc., and is not particularly limited herein.
The web page editor may be a hypertext markup language (Hyper Text Markup Language, HTML) editor, such as an HTML5 editor, among others.
Specifically, the position change of a first webpage element in a current editing page in a webpage editor is monitored in real time, and when the position change of the first webpage element is detected, at least one second webpage element in the current editing page is obtained as a reference webpage element. The change in the position of the first web page element may be manifested as a movement or deformation of the first web page element, e.g., a user dragging the first web page element in the current editing page, thereby causing the first web page element to move or deform.
The deformation scene generated by the first webpage element includes dragging any side or any vertex of the first circumscribed rectangle to deform (for example, zoom in or zoom out, which may or may not be equal-scaled).
Step S12: and generating a first circumscribed rectangle according to the first webpage element, and generating a second circumscribed rectangle according to the reference webpage element.
In order to distinguish the circumscribed rectangles of different webpage elements herein, the circumscribed rectangle corresponding to the first webpage element is defined as a first circumscribed rectangle, and the circumscribed rectangle corresponding to the second webpage element is defined as a second circumscribed rectangle.
The web page element is contained inside a circumscribed rectangle, and the circumscribed rectangle may be a minimum circumscribed rectangle, that is, a maximum range of a two-dimensional shape (such as a circle, a point, and a polygon) corresponding to the web page element expressed by two-dimensional coordinates, specifically, a rectangle with a lower boundary defined by a maximum abscissa, a minimum abscissa, a maximum ordinate, and a minimum ordinate in each vertex of the given two-dimensional shape.
Step S13: and determining a first point according to the first circumscribed rectangle, and determining a second point according to the second circumscribed rectangle.
The first point may be one or more points, and may specifically be points or center points on four sides of the first circumscribed rectangle, where the points on the four sides may specifically be four vertices (including an upper left point, a lower left point, an upper right point, and a lower right point). Similarly, the second point may be one or more points, and may specifically be points or center points on four sides of the second external rectangle, where the points on the four sides may specifically be four vertices (including an upper left point, a lower left point, an upper right point, and a lower right point).
Step S14: determining a reference line from the first point and the second point; wherein the reference line is a line segment.
Wherein the reference line comprises a horizontal reference line and/or a vertical reference line.
Wherein the reference line does not exceed the boundary line of the first circumscribed rectangle and/or the second circumscribed rectangle.
According to the embodiment, at least one second webpage element in a current editing page is obtained as a reference webpage element according to the position change of the first webpage element in the current editing page in the webpage editor, a first external rectangle is generated according to the first webpage element, a second external rectangle is generated according to the reference webpage element, a first point is determined according to the first external rectangle, a second point is determined according to the second external rectangle, a reference line is determined according to the first point and the second point, the reference line is a line segment, and therefore the reference line is determined to be a line segment through the points in the external rectangle, so that disorder of the corresponding reference line when the page elements in the editing page are more can be avoided, and the relation between the external rectangle and the external rectangle is not needed to be considered.
In an alternative embodiment, step S14 specifically includes:
step S141: a first distance between the points is determined from the first point and the second point.
Wherein, there may be one or more first points and one or more second points, and when the first point and the second point are both one, the obtained first distance is also one, that is, the distance between the first point and the second point, specifically, the distance from the first point to the second point in the x direction or the y direction. When the first point is plural and/or the second point is plural, the obtained first distance is plural.
Step S142: and determining a reference line according to the first distance.
When the first distance is one, the corresponding points are a first point and a second point, the reference line is directly determined according to the second point, and two end points of the reference line are further determined. When the first distance is multiple, the corresponding first points are multiple and/or the corresponding second points are multiple, at this time, one point is selected from the multiple first points and one point is selected from the multiple second points according to the first distance, and the reference line and the corresponding two endpoints are determined according to the two selected points.
In an alternative embodiment, step S141 specifically includes:
step S1411: and taking the calculated distance between each first point and each second point as a second distance if the first points are a plurality of points, and/or taking the calculated distance between each first point and each second point as a third distance if the second points are a plurality of points.
Specifically, the second distance is a plurality of distances, and may specifically be a distance from the first point to the second point in the x direction or the y direction. Similarly, the third distance may be plural, and may specifically be a distance from the first point to the second point in the x direction or the y direction.
Step S1412: and selecting a minimum distance from the second distance and the third distance as the first distance.
And when the first point is a plurality of points and/or the second point is a plurality of points, taking the minimum distance in all the calculated distances of the first point and the second point as a first distance.
In an alternative embodiment, step S1412 specifically includes:
step A: and determining a corresponding third point from the plurality of first points according to the first distance, and determining a corresponding fourth point from the plurality of second points.
Wherein the first distance is the minimum distance, and two points with the minimum distance are determined according to the minimum distance, wherein one point is one point of a plurality of first points, which is denoted as a third point, and the other point is one point of a plurality of second points, which is denoted as a fourth point.
And (B) step (B): the reference line is determined according to the third point and the fourth point.
The reference line is drawn after the reference line is obtained, and when drawing, drawing may be performed using a line type, a color, or the like set in advance.
In an alternative embodiment, step B specifically includes:
step B1: and if the first distance is smaller than the preset distance, determining the reference line according to the coordinates of the third point and the coordinates of the fourth point.
Specifically, the entire current editing page may be placed in a two-dimensional coordinate system, and coordinates of a point corresponding to the first circumscribed rectangle and coordinates of a point corresponding to the second circumscribed rectangle are determined in the two-dimensional coordinate system, where the third point is any one of the corresponding points of the first circumscribed rectangle, and the fourth point is any one of the corresponding points of the second circumscribed rectangle.
Since the coordinates of the corresponding point of the first circumscribed rectangle and the coordinates of the corresponding point of the second circumscribed rectangle are known, the coordinates of the two end points of the third point can be determined according to the coordinates of the corresponding point of the first circumscribed rectangle, and the coordinates of the two end points of the fourth point can be determined according to the coordinates of the corresponding point of the second circumscribed rectangle.
In an alternative embodiment, step B1 specifically includes:
step B11: determining a fifth point according to the coordinates of the third point and the coordinates of the fourth point; wherein the x-coordinate of the fifth point is the same as the x-coordinate of the fourth point or the y-coordinate of the fifth point is the same as the y-coordinate of the fourth point.
Step B12: a line passing through the fifth point and the fourth point is taken as the reference line.
Step B13: and acquiring a point with the minimum coordinate value and a point with the maximum coordinate value along the reference line as two end points of the reference line respectively.
Specifically, taking a reference line in a horizontal direction as an example, setting the y coordinate of the third point as the y coordinate of the fourth point to obtain a fifth point, then taking a line passing through the fifth point and the fourth point as the reference line, finally determining points on the first circumscribed rectangle and the second circumscribed rectangle contained on the reference line, and then selecting a point with the minimum coordinate value and a point with the maximum coordinate value as two end points of the reference line respectively. Similarly, when determining a reference line in the vertical direction, setting the x coordinate of the third point to the x coordinate of the fourth point to obtain a fifth point, then using a line passing through the fifth point and the fourth point as the reference line, finally determining the points on the first circumscribed rectangle and the second circumscribed rectangle contained on the reference line, and then selecting a point with the minimum coordinate value and a point with the maximum coordinate value as two end points of the reference line respectively
It will be appreciated by those skilled in the art that obvious modifications (e.g., combinations of the listed modes) or equivalent substitutions may be made on the basis of the above-described embodiments.
In the foregoing, although the steps in the embodiments of the reference line processing method are described in the above order, it should be clear to those skilled in the art that the steps in the embodiments of the disclosure are not necessarily performed in the above order, but may be performed in reverse order, parallel, cross, etc., and other steps may be further added by those skilled in the art on the basis of the above steps, and these obvious modifications or equivalent alternatives should also be included in the protection scope of the disclosure and are not repeated herein.
The following is an embodiment of the disclosed apparatus, which may be used to perform steps implemented by an embodiment of the disclosed method, and for convenience of explanation, only those portions relevant to the embodiment of the disclosed method are shown, and specific technical details are not disclosed, referring to the embodiment of the disclosed method.
Example two
In order to solve the technical problem that the edited pages are disordered due to the fact that corresponding reference lines are more when page elements are more in the prior art, the embodiment of the disclosure provides a reference line processing device. The apparatus may perform the steps of the reference line processing method embodiment described in the first embodiment. As shown in fig. 2, the apparatus mainly includes: a web page element acquisition module 21, an external rectangle generation module 22, a point determination module 23 and a reference line determination module 24; wherein, the liquid crystal display device comprises a liquid crystal display device,
the webpage element obtaining module 21 is configured to obtain, as a reference webpage element, at least one second webpage element located in a current editing page according to a position change of a first webpage element in the current editing page in a webpage editor;
the circumscribed rectangle generating module 22 is configured to generate a first circumscribed rectangle according to the first webpage element, and generate a second circumscribed rectangle according to the reference webpage element;
the point determining module 23 is configured to determine a first point according to the first circumscribed rectangle, and determine a second point according to the second circumscribed rectangle;
the reference line determination module 24 is configured to determine a reference line according to the first point and the second point; wherein the reference line is a line segment.
Further, the reference line does not exceed the boundary line of the first circumscribed rectangle and/or the second circumscribed rectangle.
Further, the reference line determining module 24 includes: a distance determination unit 241 and a reference line determination unit 242; wherein, the liquid crystal display device comprises a liquid crystal display device,
the distance determining unit 241 is configured to determine a first distance between points according to the first point and the second point;
the reference line determining unit 242 is configured to determine a reference line according to the first distance.
Further, the distance determining unit 241 is specifically configured to: taking the calculated distance between each first point and each second point as a second distance if the first points are a plurality of, and/or taking the calculated distance between each first point and each second point as a third distance if the second points are a plurality of; and selecting a minimum distance from the second distance and the third distance as the first distance.
Further, the reference line determining unit 242 is specifically configured to: determining a corresponding third point from a plurality of first points according to the first distance, and determining a corresponding fourth point from a plurality of second points; and determining a reference line according to the third point and the fourth point.
Further, the reference line determining unit 242 is specifically configured to: and if the first distance is smaller than the preset distance, determining the reference line according to the coordinates of the third point and the coordinates of the fourth point.
Further, the reference line determining unit 242 is specifically configured to: determining a fifth point according to the coordinates of the third point and the coordinates of the fourth point; wherein the x-coordinate of the fifth point is the same as the x-coordinate of the fourth point or the y-coordinate of the fifth point is the same as the y-coordinate of the fourth point; taking a line passing through the fifth point and the fourth point as the reference line; and acquiring a point with the minimum coordinate value and a point with the maximum coordinate value along the reference line as two end points of the reference line respectively.
For detailed descriptions of the working principles, the technical effects, etc. of the reference line processing apparatus embodiment, reference may be made to the related descriptions in the foregoing reference line processing method embodiment, and details are not repeated herein.
Example IV
Referring now to fig. 3, a schematic diagram of an electronic device 300 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 3 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 3, the electronic device 300 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 301 that may perform various suitable actions and processes in accordance with a program stored in a Read Only Memory (ROM) 302 or a program loaded from a storage means 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic apparatus 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
In general, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 307 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 308 including, for example, magnetic tape, hard disk, etc.; and communication means 309. The communication means 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. While fig. 3 shows an electronic device 300 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via a communication device 309, or installed from a storage device 308, or installed from a ROM 302. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing means 301.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring at least one second webpage element positioned in a current editing page as a reference webpage element according to the position change of a first webpage element in the current editing page in a webpage editor; generating a first external rectangle according to the first webpage element, and generating a second external rectangle according to the reference webpage element; determining a first point according to the first circumscribed rectangle, and determining a second point according to the second circumscribed rectangle; determining a reference line from the first point and the second point; wherein the reference line is a line segment.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the unit does not in any way constitute a limitation of the unit itself, for example the first acquisition unit may also be described as "unit acquiring at least two internet protocol addresses".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, there is provided a reference line processing method including:
acquiring at least one second webpage element positioned in a current editing page as a reference webpage element according to the position change of a first webpage element in the current editing page in a webpage editor;
generating a first external rectangle according to the first webpage element, and generating a second external rectangle according to the reference webpage element;
determining a first point according to the first circumscribed rectangle, and determining a second point according to the second circumscribed rectangle;
determining a reference line from the first point and the second point; wherein the reference line is a line segment.
Further, the reference line does not exceed the boundary line of the first circumscribed rectangle and/or the second circumscribed rectangle.
Further, the determining a reference line according to the first point and the second point includes:
determining a first distance between points according to the first point and the second point;
and determining a reference line according to the first distance.
Further, the determining the first distance between the points according to the first point and the second point includes:
taking the calculated distance between each first point and each second point as a second distance if the first points are a plurality of, and/or taking the calculated distance between each first point and each second point as a third distance if the second points are a plurality of;
and selecting a minimum distance from the second distance and the third distance as the first distance.
Further, the determining a reference line according to the first distance includes:
determining a corresponding third point from a plurality of first points according to the first distance, and determining a corresponding fourth point from a plurality of second points;
and determining a reference line according to the third point and the fourth point.
Further, the determining the reference line according to the third point and the fourth point includes:
and if the first distance is smaller than the preset distance, determining the reference line according to the coordinates of the third point and the coordinates of the fourth point.
Further, the determining the reference line according to the coordinates of the third point and the coordinates of the fourth point includes:
determining a fifth point according to the coordinates of the third point and the coordinates of the fourth point; wherein the x-coordinate of the fifth point is the same as the x-coordinate of the fourth point or the y-coordinate of the fifth point is the same as the y-coordinate of the fourth point;
taking a line passing through the fifth point and the fourth point as the reference line;
and acquiring a point with the minimum coordinate value and a point with the maximum coordinate value along the reference line as two end points of the reference line respectively.
According to one or more embodiments of the present disclosure, there is provided a reference line processing apparatus including:
the webpage element acquisition module is used for acquiring at least one second webpage element positioned in the current editing page as a reference webpage element according to the position change of the first webpage element in the current editing page in the webpage editor;
the external rectangle generation module is used for generating a first external rectangle according to the first webpage element and generating a second external rectangle according to the reference webpage element;
the point determining module is used for determining a first point according to the first circumscribed rectangle and determining a second point according to the second circumscribed rectangle;
a reference line determining module for determining a reference line according to the first point and the second point; wherein the reference line is a line segment.
Further, the reference line does not exceed the boundary line of the first circumscribed rectangle and/or the second circumscribed rectangle.
Further, the reference line determining module includes:
a distance determining unit configured to determine a first distance between points according to the first point and the second point;
and the reference line determining unit is used for determining a reference line according to the first distance.
Further, the distance determining unit is specifically configured to: taking the calculated distance between each first point and each second point as a second distance if the first points are a plurality of, and/or taking the calculated distance between each first point and each second point as a third distance if the second points are a plurality of; and selecting a minimum distance from the second distance and the third distance as the first distance.
Further, the reference line determining unit is specifically configured to: determining a corresponding third point from a plurality of first points according to the first distance, and determining a corresponding fourth point from a plurality of second points; and determining a reference line according to the third point and the fourth point.
Further, the reference line determining unit is specifically configured to: and if the first distance is smaller than the preset distance, determining the reference line according to the coordinates of the third point and the coordinates of the fourth point.
Further, the reference line determining unit is specifically configured to: determining a fifth point according to the coordinates of the third point and the coordinates of the fourth point; wherein the x-coordinate of the fifth point is the same as the x-coordinate of the fourth point or the y-coordinate of the fifth point is the same as the y-coordinate of the fourth point; taking a line passing through the fifth point and the fourth point as the reference line; and acquiring a point with the minimum coordinate value and a point with the maximum coordinate value along the reference line as two end points of the reference line respectively.
According to one or more embodiments of the present disclosure, there is provided an electronic device including:
a memory for storing non-transitory computer readable instructions; and
and a processor configured to execute the computer readable instructions, such that the processor performs the reference line processing method described above.
According to one or more embodiments of the present disclosure, there is provided a computer-readable storage medium storing non-transitory computer-readable instructions that, when executed by a computer, cause the computer to perform the above-described reference line processing method.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (8)

1. A reference line processing method, comprising:
acquiring at least one second webpage element positioned in a current editing page as a reference webpage element according to the position change of a first webpage element in the current editing page in a webpage editor;
generating a first external rectangle according to the first webpage element, and generating a second external rectangle according to the reference webpage element;
determining a first point according to the first circumscribed rectangle, and determining a second point according to the second circumscribed rectangle;
determining a reference line from the first point and the second point; wherein the reference line is a line segment; the reference lines comprise horizontal reference lines and/or vertical reference lines; the reference line does not exceed the boundary line of the first circumscribed rectangle and/or the second circumscribed rectangle;
the reference line is determined according to a first distance;
the first distance is determined by:
taking the calculated distance between each first point and each second point as a second distance if the first points are a plurality of, and/or taking the calculated distance between each first point and each second point as a third distance if the second points are a plurality of;
and selecting a minimum distance from the second distance and the third distance as the first distance.
2. The method of claim 1, wherein said determining a reference line from said first point and said second point comprises:
determining a first distance between points according to the first point and the second point;
and determining a reference line according to the first distance.
3. The method of claim 1, wherein the reference line is determined by:
determining a corresponding third point from a plurality of first points according to the first distance, and determining a corresponding fourth point from a plurality of second points;
the reference line is determined according to the third point and the fourth point.
4. A method according to claim 3, wherein said determining said reference line from said third point and said fourth point comprises:
and if the first distance is smaller than the preset distance, determining the reference line according to the coordinates of the third point and the coordinates of the fourth point.
5. The method of claim 4, wherein the determining the reference line from the coordinates of the third point and the coordinates of the fourth point comprises:
determining a fifth point according to the coordinates of the third point and the coordinates of the fourth point; wherein the x-coordinate of the fifth point is the same as the x-coordinate of the fourth point or the y-coordinate of the fifth point is the same as the y-coordinate of the fourth point;
taking a line passing through the fifth point and the fourth point as the reference line;
and acquiring a point with the minimum coordinate value and a point with the maximum coordinate value along the reference line as two end points of the reference line respectively.
6. A reference line processing apparatus, comprising:
the webpage element acquisition module is used for acquiring at least one second webpage element positioned in the current editing page as a reference webpage element according to the position change of the first webpage element in the current editing page in the webpage editor;
the external rectangle generation module is used for generating a first external rectangle according to the first webpage element and generating a second external rectangle according to the reference webpage element;
the point determining module is used for determining a first point according to the first circumscribed rectangle and determining a second point according to the second circumscribed rectangle;
a reference line determining module for determining a reference line according to the first point and the second point; wherein the reference line is a line segment; the reference lines comprise horizontal reference lines and/or vertical reference lines; the reference line does not exceed the boundary line of the first circumscribed rectangle and/or the second circumscribed rectangle;
the reference line is determined according to a first distance;
the first distance is determined by:
taking the calculated distance between each first point and each second point as a second distance if the first points are a plurality of, and/or taking the calculated distance between each first point and each second point as a third distance if the second points are a plurality of;
and selecting a minimum distance from the second distance and the third distance as the first distance.
7. An electronic device, comprising:
a memory for storing non-transitory computer readable instructions; and
a processor for executing the computer readable instructions such that the processor, when executed, implements the reference line processing method according to any one of claims 1-5.
8. A computer readable storage medium storing non-transitory computer readable instructions which, when executed by a computer, cause the computer to perform the reference line processing method of any one of claims 1-5.
CN202010357127.4A 2020-04-29 2020-04-29 Reference line processing method and device Active CN111563214B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010357127.4A CN111563214B (en) 2020-04-29 2020-04-29 Reference line processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010357127.4A CN111563214B (en) 2020-04-29 2020-04-29 Reference line processing method and device

Publications (2)

Publication Number Publication Date
CN111563214A CN111563214A (en) 2020-08-21
CN111563214B true CN111563214B (en) 2023-05-16

Family

ID=72074465

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010357127.4A Active CN111563214B (en) 2020-04-29 2020-04-29 Reference line processing method and device

Country Status (1)

Country Link
CN (1) CN111563214B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10222689A (en) * 1996-12-02 1998-08-21 Nippon Telegr & Teleph Corp <Ntt> Method for displaying graphic and device therefor and storage medium for storing graphic display program
CN106201201A (en) * 2016-07-07 2016-12-07 广州视睿电子科技有限公司 View method of adjustment and system
CN107220933A (en) * 2017-05-11 2017-09-29 上海联影医疗科技有限公司 A kind of reference line determines method and system
CN108734752A (en) * 2018-04-19 2018-11-02 阿里巴巴集团控股有限公司 Show the method, apparatus and electronic equipment of the data information in chart
CN110968987A (en) * 2018-09-30 2020-04-07 腾讯科技(深圳)有限公司 Table display method and device, storage medium and electronic device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10222689A (en) * 1996-12-02 1998-08-21 Nippon Telegr & Teleph Corp <Ntt> Method for displaying graphic and device therefor and storage medium for storing graphic display program
CN106201201A (en) * 2016-07-07 2016-12-07 广州视睿电子科技有限公司 View method of adjustment and system
CN107220933A (en) * 2017-05-11 2017-09-29 上海联影医疗科技有限公司 A kind of reference line determines method and system
CN108734752A (en) * 2018-04-19 2018-11-02 阿里巴巴集团控股有限公司 Show the method, apparatus and electronic equipment of the data information in chart
CN110968987A (en) * 2018-09-30 2020-04-07 腾讯科技(深圳)有限公司 Table display method and device, storage medium and electronic device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
向阳洁,何潇.CorelDRAW在科技期刊制图中的应用.怀化学院学报.2004,(05),全文. *

Also Published As

Publication number Publication date
CN111563214A (en) 2020-08-21

Similar Documents

Publication Publication Date Title
CN111461968B (en) Picture processing method, device, electronic equipment and computer readable medium
CN111259636B (en) Document rendering method and device and electronic equipment
CN112053286B (en) Image processing method, device, electronic equipment and readable medium
CN111563214B (en) Reference line processing method and device
CN113506356B (en) Method and device for drawing area map, readable medium and electronic equipment
CN111273884A (en) Image display method and device and electronic equipment
CN111753230B (en) Reference line processing method and device
CN113255812B (en) Video frame detection method and device and electronic equipment
CN111258582B (en) Window rendering method and device, computer equipment and storage medium
CN111259291B (en) View display method and device and electronic equipment
CN111338827B (en) Method and device for pasting form data and electronic equipment
CN111460334B (en) Information display method and device and electronic equipment
CN114419298A (en) Virtual object generation method, device, equipment and storage medium
CN110807164B (en) Automatic image area adjusting method and device, electronic equipment and computer readable storage medium
CN112395826B (en) Text special effect processing method and device
CN111489286B (en) Picture processing method, device, equipment and medium
CN114066721B (en) Display method and device and electronic equipment
CN114359673B (en) Small sample smoke detection method, device and equipment based on metric learning
CN114357348B (en) Display method and device and electronic equipment
CN114911564B (en) Page movement processing method, device, equipment and storage medium
CN112380821B (en) Graphic display method and device and electronic equipment
CN114510309B (en) Animation effect setting method, device, equipment and medium
CN111026983B (en) Method, device, medium and electronic equipment for realizing hyperlink
CN114327188B (en) Form layout method, form layout device, electronic equipment and computer readable medium
CN117453075A (en) Display control method, display control device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant