Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

1// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
2// SPDX-License-Identifier: Apache-2.0
3// SPDX-License-Identifier: MIT
4
5use crate::dpi::{PhysicalPosition, PhysicalSize};
6
7/// Monitor descriptor.
8#[derive(Debug, Clone)]
9pub struct Monitor {
10 /// A human-readable name of the monitor.
11 /// `None` if the monitor doesn't exist anymore.
12 pub name: Option<String>,
13 /// The monitor's resolution.
14 pub size: PhysicalSize<u32>,
15 /// The top-left corner position of the monitor relative to the larger full screen area.
16 pub position: PhysicalPosition<i32>,
17 /// Returns the scale factor that can be used to map logical pixels to physical pixels, and vice versa.
18 pub scale_factor: f64,
19}
20

After

1// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
2// SPDX-License-Identifier: Apache-2.0
3// SPDX-License-Identifier: MIT
4
5use crate::dpi::{PhysicalPosition, PhysicalRect, PhysicalSize};
6
7/// Monitor descriptor.
8#[derive(Debug, Clone)]
9pub struct Monitor {
10 /// A human-readable name of the monitor.
11 /// `None` if the monitor doesn't exist anymore.
12 pub name: Option<String>,
13 /// The monitor's resolution.
14 pub size: PhysicalSize<u32>,
15 /// The top-left corner position of the monitor relative to the larger full screen area.
16 pub position: PhysicalPosition<i32>,
17 /// The monitor's work_area.
18 pub work_area: PhysicalRect<i32, u32>,
19 /// Returns the scale factor that can be used to map logical pixels to physical pixels, and vice versa.
20 pub scale_factor: f64,
21}
22

Before

source_file
line_comment
// "//"
line_comment
// "//"
line_comment
// "//"
use_declaration
use "use"
scoped_use_list
scoped_identifier
crate "crate"
:: "::"
identifier "dpi"
:: "::"
use_list
{ "{"
identifier "PhysicalPosition"
, ","
identifier "PhysicalSize"
} "}"
; ";"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Monitor descriptor.\n"
attribute_item
# "#"
[ "["
attribute
identifier "derive"
token_tree
( "("
identifier "Debug"
, ","
identifier "Clone"
) ")"
] "]"
struct_item
visibility_modifier
pub "pub"
struct "struct"
type_identifier "Monitor"
field_declaration_list
{ "{"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " A human-readable name of the monitor.\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " `None` if the monitor doesn't exist anymore.\n"
field_declaration
visibility_modifier
pub "pub"
field_identifier "name"
: ":"
generic_type
type_identifier "Option"
type_arguments
< "<"
type_identifier "String"
> ">"
, ","
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " The monitor's resolution.\n"
field_declaration
visibility_modifier
pub "pub"
field_identifier "size"
: ":"
generic_type
type_identifier "PhysicalSize"
type_arguments
< "<"
primitive_type "u32"
> ">"
, ","
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " The top-left corner position of the monitor relative to the"...
field_declaration
visibility_modifier
pub "pub"
field_identifier "position"
: ":"
generic_type
type_identifier "PhysicalPosition"
type_arguments
< "<"
primitive_type "i32"
> ">"
, ","
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Returns the scale factor that can be used to map logical pi"...
field_declaration
visibility_modifier
pub "pub"
field_identifier "scale_factor"
: ":"
primitive_type "f64"
, ","
} "}"

After

source_file
line_comment
// "//"
line_comment
// "//"
line_comment
// "//"
use_declaration
use "use"
scoped_use_list
scoped_identifier
crate "crate"
:: "::"
identifier "dpi"
:: "::"
use_list
{ "{"
identifier "PhysicalPosition"
, ","
identifier "PhysicalRect"
, ","
identifier "PhysicalSize"
} "}"
; ";"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Monitor descriptor.\n"
attribute_item
# "#"
[ "["
attribute
identifier "derive"
token_tree
( "("
identifier "Debug"
, ","
identifier "Clone"
) ")"
] "]"
struct_item
visibility_modifier
pub "pub"
struct "struct"
type_identifier "Monitor"
field_declaration_list
{ "{"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " A human-readable name of the monitor.\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " `None` if the monitor doesn't exist anymore.\n"
field_declaration
visibility_modifier
pub "pub"
field_identifier "name"
: ":"
generic_type
type_identifier "Option"
type_arguments
< "<"
type_identifier "String"
> ">"
, ","
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " The monitor's resolution.\n"
field_declaration
visibility_modifier
pub "pub"
field_identifier "size"
: ":"
generic_type
type_identifier "PhysicalSize"
type_arguments
< "<"
primitive_type "u32"
> ">"
, ","
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " The top-left corner position of the monitor relative to the"...
field_declaration
visibility_modifier
pub "pub"
field_identifier "position"
: ":"
generic_type
type_identifier "PhysicalPosition"
type_arguments
< "<"
primitive_type "i32"
> ">"
, ","
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " The monitor's work_area.\n"
field_declaration
visibility_modifier
pub "pub"
field_identifier "work_area"
: ":"
generic_type
type_identifier "PhysicalRect"
type_arguments
< "<"
primitive_type "i32"
, ","
primitive_type "u32"
> ">"
, ","
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Returns the scale factor that can be used to map logical pi"...
field_declaration
visibility_modifier
pub "pub"
field_identifier "scale_factor"
: ":"
primitive_type "f64"
, ","
} "}"