Skip to content

Commit

Permalink
Fix #24
Browse files Browse the repository at this point in the history
  • Loading branch information
reknih committed Oct 21, 2023
1 parent ab188ac commit 7a03bb8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/annotations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl<'a> Annotation<'a> {

/// Start writing the `/MK` dictionary. Only permissible for the subtype
/// `Widget`.
pub fn appearance(&mut self) -> Appearance<'_> {
pub fn appearance_characteristics(&mut self) -> AppearanceCharacteristics<'_> {
self.dict.insert(Name(b"MK")).start()
}

Expand Down Expand Up @@ -328,16 +328,16 @@ bitflags::bitflags! {
}
}

/// Writer for an _appearance dictionary_.
/// Writer for an _appearance characteristics dictionary_.
///
/// This struct is created by [`Annotation::appearance`].
pub struct Appearance<'a> {
pub struct AppearanceCharacteristics<'a> {
dict: Dict<'a>,
}

writer!(Appearance: |obj| Self { dict: obj.dict() });
writer!(AppearanceCharacteristics: |obj| Self { dict: obj.dict() });

impl<'a> Appearance<'a> {
impl<'a> AppearanceCharacteristics<'a> {
/// Write the `/R` attribute. This is the number of degrees the widget
/// annotation should be rotated by counterclockwise relative to its page
/// when displayed. This should be a multiple of 90.
Expand Down Expand Up @@ -462,7 +462,7 @@ impl<'a> Appearance<'a> {
}
}

deref!('a, Appearance<'a> => Dict<'a>, dict);
deref!('a, AppearanceCharacteristics<'a> => Dict<'a>, dict);

/// The position the text of the widget annotation's caption relative to its
/// icon.
Expand Down
3 changes: 1 addition & 2 deletions src/forms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ impl<'a> Field<'a> {

/// Start writing the `/Kids` attribute to set the immediate children of
/// this field. These references shall refer to other [fields][Field], or
/// [widget](crate::types::AnnotationType::Widget)
/// [annoations](Annotation).
/// [widget](crate::types::AnnotationType::Widget) [annoations](Annotation).
pub fn children(&mut self) -> TypedArray<'_, Ref> {
self.dict.insert(Name(b"Kids")).array().typed()
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ mod xobject;
pub mod writers {
use super::*;
pub use actions::{Action, AdditionalActions, Fields};
pub use annotations::{Annotation, Appearance, BorderStyle, IconFit};
pub use annotations::{Annotation, AppearanceCharacteristics, BorderStyle, IconFit};
pub use attributes::{
Attributes, FieldAttributes, LayoutAttributes, ListAttributes, TableAttributes,
UserProperty,
Expand Down

0 comments on commit 7a03bb8

Please sign in to comment.