A non-transitory computer readable storage medium system, storing one or more programs that when executed by a computer system having a display generation component, an input device, and one or more cameras, cause the computer system to:
- display, via the display generation component, a representation of a field of view of the one or more cameras, the field of view including a plurality of objects in a physical environment, the plurality of objects including a first physical object having a first surface, a second physical object positioned on the first surface, and a third physical object positioned on the first surface, wherein the second physical object extends from the first surface less than a threshold amount in a respective direction and the third physical object extends from the first surface more than the threshold amount in the respective direction;
- receive one or more first user inputs that correspond to a request to place or move a first virtual object at or to a location in the representation of the field of view that corresponds to a physical location on or near the first surface of the first physical object;
- in response to the one or more first user inputs:
- move the first virtual object in the representation of the field of view from a prior position on the first surface of the first physical object that does not include other physical objects to a new position on the first surface of the first physical object, the new position comprising a position of the first virtual object in the physical environment after moving the first virtual object in accordance with the one or more first user inputs;
- and
- wherein moving the first virtual object in the representation of the field of view from the prior position on the first surface to the new position on the first surface of the first physical object includes:
- in accordance with a determination that the new position of the first virtual object in the physical environment does not coincide with any physical object positioned on the first surface, displaying the first virtual object in the representation of the field of view as being placed on the first surface;
- in accordance with a determination that the new position of the first virtual object in the physical environment coincides with the second physical object positioned on the first surface and that the second physical object extends from the first surface less than the threshold amount in the respective direction, displaying the first virtual object in the representation of the field of view as being placed on the first surface at a position that coincides with the second physical object, rather than being placed on top of the second physical object, with a same predefined spatial relationship to the representation of the first surface while the first virtual object is at the prior position and while the first virtual object is at the new position that coincides with the second physical object positioned on the first surface;
- and
- in accordance with a determination that the new position of the first virtual object in the physical environment is on top of the third physical object positioned on the first surface and that the third physical object extends from the first surface more than the threshold amount in the respective direction, displaying the first virtual object in the representation of the field of view as being placed on top of the third physical object, wherein, in the representation of the field of view, a representation of third physical object is positioned between a representation of the first physical object and the first virtual object.